Go to the first, previous, next, last section, table of contents.


3.5.6 Real Types

  1. Real types provide approximations to the real numbers, with relative bounds on errors for floating point types, and with absolute bounds for fixed point types.

    Syntax

  2. real_type_definition ::=
       floating_point_definition | fixed_point_definition
    

    Static Semantics

  3. A type defined by a real_type_definition is implicitly derived from root_real, an anonymous predefined (specific) real type. Hence, all real types, whether floating point or fixed point, are in the derivation class rooted at root_real.
  4. Real literals are all of the type universal_real, the universal type, See section 3.4.1 Derivation Classes, for the class rooted at root_real, allowing their use with the operations of any real type. Certain multiplying operators have a result type of universal_fixed, See section 4.5.5 Multiplying Operators, the universal type for the class of fixed point types, allowing the result of the multiplication or division to be used where any specific fixed point type is expected.

    Dynamic Semantics

  5. The elaboration of a real_type_definition consists of the elaboration of the floating_point_definition or the fixed_point_definition.

    Implementation Requirements

  6. An implementation shall perform the run-time evaluation of a use of a predefined operator of root_real with an accuracy at least as great as that of any floating point type definable by a floating_point_definition.

    Implementation Permissions

  7. For the execution of a predefined operation of a real type, the implementation need not raise Constraint_Error if the result is outside the base range of the type, so long as the correct result is produced, or the Machine_Overflows attribute of the type is false, See section G.2 Numeric Performance Requirements.
  8. An implementation may provide nonstandard real types, descendants of root_real that are declared outside of the specification of package Standard, which need not have all the standard characteristics of a type defined by a real_type_definition. For example, a nonstandard real type might have an asymmetric or unsigned base range, or its predefined operations might wrap around or "saturate" rather than overflow (modular or saturating arithmetic), or it might not conform to the accuracy model, See section G.2 Numeric Performance Requirements. Any type descended from a nonstandard real type is also nonstandard. An implementation may place arbitrary restrictions on the use of such types; it is implementation defined whether operators that are predefined for "any real type" are defined for a particular nonstandard real type. In any case, such types are not permitted as explicit_generic_actual_parameters for formal scalar types -- See section 12.5.2 Formal Scalar Types.

    NOTES

  9. (32) As stated, real literals are of the anonymous predefined real type universal_real. Other real types have no literals. However, the overload resolution rules, See section 8.6 The Context of Overload Resolution, allow expressions of the type universal_real whenever a real type is expected.


Go to the first, previous, next, last section, table of contents.