411 REFERENCE · Wikibooks
Ada Programming/Attributes/'Modulus
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Attributes 'Modulus
__TOC__
Description
X'Modulus is an Ada attribute where X is any modular type. This returns the modulus of X.
Example
type Unsigned_Byte is mod 2**8;
type Unsigned_Word is mod 2**16;
Assert (Unsigned_Byte'Modulus = 256); Ok
Assert (Unsigned_Word'Modulus = 65536); Ok
See also
Wikibook
Ada Programming
Ada Programming/Attributes
Ada Reference Manual
3 5-4 Integer Types
K Language-Defined Attributes
Truncation