411 REFERENCE · Wikibooks
Ada Programming/Attributes/'Fixed Value
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Description
For every fixed-point type S, S'Fixed_Value denotes a function with the following specification:function S'Fixed_Value (Arg : <Universal_Integer>) return S;The value returned is the fixed-point value V such that:V = Arg * S'SmallThe effect is thus similar to first converting the argument to the integer type used to represent S, and then doing an unchecked conversion to the fixed-point type. The difference is that there are full range checks, to ensure that the result is in range. This attribute is primarily intended for use in implementation of the input-output functions for fixed-point values.