fix2flt - convert a value or values from fixed-point to floating-point
val.fix2flt(typ)
val must be a Byte
,
Ubyte
, Short
,
Ushort
, or an array of those types
typ must be one of Half
,
Float
, or Double
fix2flt
converts a value or array of values
from 8- or 16-bit signed or unsigned integers to the specified
floating point type (Half
,
Float
, or Double
). The result
is clamped to the range -1.0 to 1.0, inclusive. The conversion
factors are:
Source type | Multiplier |
---|---|
Byte |
1./127. |
Ubyte |
1./255. |
Short |
1./32767. |
Ushort |
1./65535. |
A floating point value of the specified Type
typ
TypeCheck
is thrown if typ is not a
Type
RangeCheck
is
thrown if typ is not one of the scalar floating point types
TypeCheck
is thrown if val does not
have a short integral type
{127b, 255ub, 32767s, 65535us}->fix2flt(Float) 1. 1. 1. 1.