From ec153fa6d7ba58a741e18f36b12736ec55243d35 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 19 Oct 2011 15:41:23 +0200 Subject: Update documentation after changes in integer and float comparison --- system/doc/reference_manual/expressions.xml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'system/doc') 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 < atom < reference < fun < port < pid < tuple < list

Lists are compared element by element. Tuples are ordered by size, two tuples with the same size are compared element by element.

-

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.

+

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.

+

Returns the Boolean value of the expression, true or false.

Examples:

-- cgit v1.2.3