Fixed-Point Blockset | ![]() ![]() |
Create a MATLAB structure describing a floating-point data type
Syntax
Description
float('single')
returns a MATLAB structure that describes the data type of an IEEE single (32 total bits, 8 exponent bits).
float('double')
returns a MATLAB structure that describes the data type of an IEEE double (64 total bits, 11 exponent bits).
float(TotalBits, ExpBits)
returns a MATLAB structure that describes a nonstandard floating-point data type that mimics the IEEE style. That is, the numbers are normalized with a hidden leading one for all exponents except the smallest possible exponent. However, the largest possible exponent might not be treated as a flag for Infs and NaNs.
float
is automatically called when a floating-point number is specified in a block dialog box.
Example
Define a nonstandard, IEEE-style, floating-point data type with 31 total bits (excluding the hidden leading one) and 9 exponent bits:
See Also
sfix
, sfrac
, sint
, ufix
, ufrac
, uint
![]() | fixpt_set_all | fpupdate | ![]() |