Ada Programming/Attributes/'Machine Mantissa

Description
X'Machine_Mantissa is an Ada attribute where X is any floating point type.

Floating point types are represented as:


 * $$sign \times mantissa \times radix^{exponent}$$

where


 * sign is 1 or -1
 * mantissa is a fraction in base radix
 * radix is the hardware radix (usually 2)
 * exponent is an integer
 * radix is the hardware radix (usually 2)
 * exponent is an integer
 * exponent is an integer

'Machine_Mantissa returns the maximum number of digits in the mantissa.

Example
Machine_Mantissa T_IO AdaText_IO I_IO   AdaText_IOInteger_IO Integer T_IOPut "Mantissa of Float type      = " I_IOPut Float T_IONew_Line T_IOPut "Mantissa of Long_Float type = " I_IOPut Long_Float T_IONew_Line Machine_Mantissa

The output with GNAT 4.6 on the x86-64 architecture is:

Mantissa of Float type      =          24 Mantissa of Long_Float type =          53

Wikibook

 * Ada Programming
 * Ada Programming/Attributes
 * Ada Programming/Attributes/'Machine_Emax
 * Ada Programming/Attributes/'Machine_Emin
 * Ada Programming/Attributes/'Machine_Radix

Ada Reference Manual


|Address Address