0 3 -5 1024 16'f3ae 0'a 15511210043330985984000000
1_3 -30517578125_32768 0_1Rational arithmetic is arbitrarily precise. When the global flag prefer_rationals is set, the system uses rational arithmetic wherever possible. In particular, dividing two integers then yields a precise rational rather than a float result.
0.0 3.141592653589793 6.02e23 -35e-12 -1.0InfECLiPSe can handle both single and double precision floats. Which precision is used depends on the setting of the global flag float_precision8.1. The default is double precision.
-0.001__0.001 3.141592653__3.141592654 1e308__1.0InfA bounded real is a representation for a real number that definitely lies somewhere between the two bounds, but the exact value cannot be determined 8.3. Bounded reals are usually not typed in by the user, they are normally the result of a computation or type coercion.
All computations with bounded reals give safe results, taking rounding errors into account. This is achieved by doing interval arithmetic on the bounds and rounding the results outwards. The resulting bounded real is then guaranteed to enclose the true real result.
Computations with floating point values result in uncertainties about the correct result. Bounded reals make this uncertainty explicit. A consequence of this is that sometimes it is conceptually not possible to decide whether two bounded reals are identical or not. This occurs when the bounds of the compared intervals overlap. In this case, the arithmetic comparisons leave a (ground) delayed goal behind which can then be inspected by the user to decide whether the match is considered close enough. The syntactial comparisons like =/2 and ==/2 only consider such bounded reals as equal which have resulted from the same computation.
integerThe operation or comparison is then carried out with this type and the result is of this type as well, unless otherwise specified. Beware of the potential loss of precision in the rational->rational->single float->double float->bounded real
->
float conversion!
Note that the system never does automatic conversions in the opposite direction.
Such conversion must be programmed explicitly using the
fix,
rational,
float and
breal
functions.