Chapter 3
Ada Language Reference
©
National Instruments Corporation
3-27
Conversion Function Instantiations
The
RT_FIXED_OPERATORS
package contains instantiations of functions
that represent conversion of values to and from a fixed-point type. The
appropriate generic function from the
SA_FIXED_GENERICS
package is
chosen to instantiate the function. The name of the instantiated function
follows a convention that indicates what type of conversion is to be done.
Table 3-10 defines the naming convention for conversion functions.
Table 3-10.
Conversion Function Naming Conventions
Conversion Type
Name
1
Fixed to
RT_INTEGER
RT_
YYxx
_I
Fixed to
RT_INTEGER
(truncation)
RT_
YYxx
_It
Fixed to
RT_INTEGER
(round)
RT_
YYxx
_Ir
Fixed to
RT_LONG_INTEGER
RT_
YYxx
_LI
Fixed to
RT_LONG_INTEGER
(truncation)
RT_
YYxx
_LIt
Fixed to
RT_LONG_INTEGER
(round)
RT_
YYxx
_LIr
Fixed to
RT_BOOLEAN
RT_
YYxx
_B
Fixed to
RT_FLOAT
RT_FLOAT
RT_INTEGER
to Fixed
RT_
YYxx
RT_LONG_INTEGER
to Fixed
RT_
YYxx
RT_BOOLEAN
to Fixed
RT_
YYxx
RT_FLOAT
to Fixed
RT_
YYxx
RT_FLOAT
to Fixed (truncation)
RT_
YYxx
t
RT_FLOAT
to Fixed (round)
RT_
YYxx
r
Fixed to Fixed (different types)
RT_
YYxx
Fixed to Fixed (different types, truncation)
RT_
YYxx
t
Fixed to Fixed (different types, round)
RT_
YYxx
r
Fixed to Fixed (same type, no-op cast)
YYxx
1
YY
indicates the short name of a fixed-point type
xx
is the two-digit radix.