As do most Prologs, XSB supports evaluation of arithmetic expressions in two ways. First, XSB supports evaluation of ground arithmetic expressions throught the is/2 operator. Support of comparisons of non-ground arithmetic expressions is provided through the port to XSB of the CLPQR constraint handling interface. In this section we describe how arithmetic expressions can be evaluated through is/2, while the CLPQR interface is described in Volume 2 of this manual.
Before describing is/2 and the expressions that it can evaluate, we note that in Version 2.5 of XSB, integers and floats in XSB are represented using a single word of 32 or 64 bits, depending on the machine architecture. Since type tags constitute part of this word, this means that there may be as little as 28 bits available to represent a floating point number. In addition, evaluation of arithmetic expressions through is/2 does not check for overflow or underflow. As a result, XSB's floating point operations do not conform to IEEE floating point standards, and deviates in this regard from the ISO Prolog standard (see [25] Section 9). We hope to fix these problems in a future release 6.1
All of the evaluable functors describe below throw a type error if their evaluated input is not numeric. We describe below only their behavior on correctly typed input.