According to ECMA standard INTEGER
is defined as an alias for one of the sized variants of integer classes with the recommended size of 64 bits. However, because there is a lot of existing code, current implementations still use 32-bit integers for INTEGER
. The size can be set by a compiler option (e.g., EiffelStudio uses an Eiffel Configuration File (ECF) to map INTEGER
to INTEGER_32
, this is done in the core library Base
). In principle, a library or an application can specify a different size for INTEGER
type using type mapping. The mechanism is not part of Eiffel language specification, therefore usually sized variants are used directly when a specific size is required.
Eiffel standard does not define precise behavior of basic types, i.e. they are treated like any other types from the language perspective. All implementations, I know of, do not check for integer overflow or underflow and silently wrap the result modulo their size.
There are several library-based solutions that provide arbitrary precision integer arithmetic:
- factorial (1994, tested with TowerEiffel 1.3.1) -
FACTORIAL
represents big integer values
- big_numbers (1998, tested with SmallEiffel -0.80) -
BIG_INTEGER
with a set of other numeric classes
- eapml (Eiffel Arbitrary Precision Mathematics Library) (contemporary, included in standard EiffelStudio distribution under contrib) -
INTEGER_X
- an arbitrary precision integer
- dcm (contemporary, included in standard EiffelStudio distribution under contrib) and gobo (contemporary, part of Gobo framework, included in standard EiffelStudio distribution under contrib) -
DECIMAL
and MA_DECIMAL
respectively - decimal numbers following the General Decimal Arithmetic Specification