Computing » Computer Science » Computer Programming » Ada Programming X'Machine_Radix is an Ada attribute where X is any floating or fixed point type. 'Machine_Radix returns the radix of the hardware representation of type X. On most machines this will be 2. with Ada.Text_IO; procedure Machine_Radix is package T_IO renames Ada.Text_IO; package I_IO is new Ada.Text_IO.Integer_IO (Integer); type My_Fixed_Point_Type is delta 0.1 range -1.0 .. 1.0; type My_Decimal_Type is delta 0.01 digits 10; begin T_IO.Put ("Radix of Float type = "); I_IO.Put (Float'Machine_Radix); T_IO.New_Line; T_IO.Put ("Radix of My_Fixed_Point_Type = "); I_IO.Put (My_Fixed_Point_Type'Machine_Radix); T_IO.New_Line; T_IO.Put ("Radix of My_Decimal_Type type = "); I_IO.Put (My_Decimal_Type'Machine_Radix); T_IO.New_Line; end Machine_Radix; The output with GNAT 4.6 on the x86-64 architecture is: Radix of Float type = 2 Radix of My_Fixed_Point_Type = 2 Radix of My_Decimal_Type type = 2 Ada Programming Ada Programming/Attributes Ada Programming/Attributes/'Machine_Emax Ada Programming/Attributes/'Machine_Emin Ada Programming/Attributes/'Machine_Mantissa 5.3 Attributes of Floating Point Types (Annotated) 5.3 Attributes of Fixed Point Types (Annotated) Annex K Language-Defined Attributes (Annotated)
{'wiki_source': 'wikibooks', 'other_info': '{\'content_model\': \'wikitext\', \'language\': \'en\', \'title\': "Ada Programming/Attributes/\'Machine Radix", \'type\': \'text\'}'}