Ada Programming/Attributes/'Digits

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Ada. Time-tested, safe and secure.
Ada. Time-tested, safe and secure.

Description[edit | edit source]

X'Digits is an Ada attribute where X is any floating point type or decimal fixed point type. This attribute represents the number of decimal digits in the mantissa of type X.

Example[edit | edit source]

type My_Float is digits 10 range 0.0 .. 100.0;
... 
pragma Assert (My_Float'Digits = 10);  -- OK

See also[edit | edit source]

Wikibook[edit | edit source]

Ada Reference Manual[edit | edit source]