Main Content

Floating-Point Specification in MATLAB

Create and use floating-point data types such as single and half

Because single precision numbers use only 32 bits, they require less memory than double-precision numbers while still offering many of the benefits of floating point arithmetic. The half-precision data type occupies only 16 bits of memory, but its floating-point representation enables it to handle wider dynamic ranges than integer or fixed-point data types of the same size. You can use a CustomFloat object to define a floating-point numeric data type with specified word length and mantissa length.

Classes

Simulink.NumericTypeSpecify floating-point, integer, or fixed-point data type
target.FloatingPointDataTypeDescribe floating point data type implemented by compiler for target hardware (Since R2021b)

Functions

expand all

singleSingle-precision arrays
halfConstruct half-precision numeric object
pow10Base 10 power and scale half-precision numbers
rsqrtReciprocal square root
fmaMultiply and add using fused multiply add approach (Since R2019a)
target.addAdd target object to internal database (Since R2019a)
target.createCreate target object (Since R2019a)
target.getRetrieve target objects from internal database (Since R2019a)
target.removeRemove target object from internal database (Since R2019a)
CustomFloatNumeric object with a custom floating-point data type (Since R2020a)

Packages

targetManage target hardware and build tool information (Since R2019a)

Topics

Related Information