| Did you know ... | Search Documentation: |
| Other Limits |
\u0000). Currently, SWI-Prolog uses a separate
representation for ISO Latin 1 text (code points
0 ... 255) and text that includes higher code points. The
latter is represented using the C wchar_t type. On most
systems this implies UCS-4, i.e., 32-bit unsigned integers. On Windows
wchar_t uses UTF-16, which implies that it cannot represent
the code points reserved for surrogate pairs as single code
points. Future versions may switch to using UTF-8 throughout.
The size of an unbounded integer is limited by the amount of memory
that is available for the global stack, i.e., by the Prolog flag
stack_limit (see section
2.19.1) and, if set, by the Prolog flag max_integer_size.
If the system is built using GMP and the C type long is
smaller than 64 bits, as is the case on Windows, GMP integers are in
addition limited to 2^32 bits, i.e., 512Mb or about 1.3 billion
decimal digits.
Arithmetic evaluation estimates the size of the result of the
functions that can create big integers (**/2, ^/2,
<</2, */2
and lcm/2) and raises
a
resource_error(stack) exception before performing
the computation if the result cannot be represented.46This
check cannot be omitted because GMP terminates the process if we ask it
for a number that does not fit in its data types.