diff doc/interpreter/expr.txi @ 9578:7dafdb8b062f

refactor comparison ops implementations
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 27 Aug 2009 11:19:33 +0200
parents 16f53d29049f
children 09da0bd91412
line wrap: on
line diff
--- a/doc/interpreter/expr.txi
+++ b/doc/interpreter/expr.txi
@@ -617,6 +617,16 @@
 True if @var{x} is not equal to @var{y}.
 @end table
 
+For complex numbers, the following ordering is defined:
+@var{z1} < @var{z2}
+iff
+@example
+  abs(@var{z1}) < abs(@var{z2}) 
+  || (abs(@var{z1}) == abs(@var{z2}) && arg(@var{z1}) < arg(@var{z2}))
+@end example
+This is consistent with the ordering used by @dfn{max}, @dfn{min} and @dfn{sort},
+but is not consistent with Matlab, which only compares the real parts.
+
 String comparisons may also be performed with the @code{strcmp}
 function, not with the comparison operators listed above.
 @xref{Strings}.