aboutsummaryrefslogtreecommitdiffstats
path: root/system/doc/reference_manual/expressions.xml
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-10-19 15:41:23 +0200
committerLukas Larsson <[email protected]>2011-10-19 15:41:23 +0200
commitec153fa6d7ba58a741e18f36b12736ec55243d35 (patch)
tree3689969f02f32228af669af0ebef910f9dee5fbf /system/doc/reference_manual/expressions.xml
parentf82d49ab3e65f52fd7b6dd7d9e8913543b7a1375 (diff)
downloadotp-ec153fa6d7ba58a741e18f36b12736ec55243d35.tar.gz
otp-ec153fa6d7ba58a741e18f36b12736ec55243d35.tar.bz2
otp-ec153fa6d7ba58a741e18f36b12736ec55243d35.zip
Update documentation after changes in integer and float comparison
Diffstat (limited to 'system/doc/reference_manual/expressions.xml')
-rw-r--r--system/doc/reference_manual/expressions.xml14
1 files changed, 9 insertions, 5 deletions
diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml
index 497d7eb464..5673f2494e 100644
--- a/system/doc/reference_manual/expressions.xml
+++ b/system/doc/reference_manual/expressions.xml
@@ -561,11 +561,15 @@ number &lt; atom &lt; reference &lt; fun &lt; port &lt; pid &lt; tuple &lt; list
<p>Lists are compared element by element. Tuples are ordered by
size, two tuples with the same size are compared element by
element.</p>
- <p>If one of the compared terms is an integer and the other a
- float, the integer is first converted into a float, unless the
- operator is one of =:= and =/=. If the integer is too big to fit
- in a float no conversion is done, but the order is determined by
- inspecting the sign of the numbers.</p>
+ <p>When comparing an integer to a float, the term with the lesser
+ precision will be converted into the other term's type, unless the
+ operator is one of =:= and =/=. A float is more precise than
+ an integer until all significant figures of the float are to the left of
+ the decimal point. This happens when the float is larger/smaller then
+ +/-9007199254740992.0. The conversion strategy is changed
+ depending on the size of the float because otherwise comparison of large
+ floats and integers would loose their transitivity.</p>
+
<p>Returns the Boolean value of the expression, <c>true</c> or
<c>false</c>.</p>
<p>Examples:</p>