diff options
author | Lukas Larsson <[email protected]> | 2011-11-01 10:10:31 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-11-01 10:10:31 +0100 |
commit | d5ebc4c1409284e0a343a64edf7d75308a1b3dd2 (patch) | |
tree | a863c845667a7a7dee0e4504c6b10aa1dfb5ed84 /system | |
parent | 668e7f7d2f8bf01f281065c19dd37dda4a499751 (diff) | |
parent | ec153fa6d7ba58a741e18f36b12736ec55243d35 (diff) | |
download | otp-d5ebc4c1409284e0a343a64edf7d75308a1b3dd2.tar.gz otp-d5ebc4c1409284e0a343a64edf7d75308a1b3dd2.tar.bz2 otp-d5ebc4c1409284e0a343a64edf7d75308a1b3dd2.zip |
Merge branch 'lukas/erts/large_float_cmp/OTP-9497'
* lukas/erts/large_float_cmp/OTP-9497:
Update documentation after changes in integer and float comparison
Do small optimisation on platforms with 32 bit Eterm
Add tests for equality checking
Optimize comparison of huge floats and smaller bignums
Add tests for comparing large floats and small bignums
Cleanup double_to_bignum conversion code
Update size of tmp cmp bignum buffer
Expand tests for float and number comparison
Update heauristic to work on halfword
Add heauristics bignum vs float checks
Optimise bugnum and small comparison
Add float vs integer comparison tests
Update integer and floating point number comparisons
Diffstat (limited to 'system')
-rw-r--r-- | system/doc/reference_manual/expressions.xml | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml index 644896cd7f..c24b1110a4 100644 --- a/system/doc/reference_manual/expressions.xml +++ b/system/doc/reference_manual/expressions.xml @@ -561,11 +561,15 @@ number < atom < reference < fun < port < pid < tuple < 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> |