halfp - A floating-point half precision support package
- E - length of the exponent (in bits)
- M - length of the mantissa (in bits)
- roundMethod - the rounding method to use when performing various arithmetic operations:
- val - a uint16 value comprises the 16-bit representation of the half-precision number.
- a.castfrom(x) - imports a's value from a 'double' or 'single' variable x.
- a.double - returns the 'double' precision value of the halp object a.
- a.single - returns the 'double' precision value of the halp object a.
- a.hex - returns the hex value of the uint16 representation of object a.
- a.bin - returns the binary value of the uint16 representation of object a.
- a.plus - supports signed addition of 2 halfp objects.
- a.minus - supports signed subtraction of 2 halfp objects.
- a.mtimes - supports signed multiplication of 2 halfp objects.
- c = a + b
- c = a - b
- c = a * b
Citar como
Alon Geva (2024). halfp - A floating-point half precision support package (https://www.mathworks.com/matlabcentral/fileexchange/112720-halfp-a-floating-point-half-precision-support-package), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxEtiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
Versión | Publicado | Notas de la versión | |
---|---|---|---|
1.0.5 | fixed description |
|
|
1.0.4 | new bugs fixes |
|
|
1.0.3 | * Added support for [+,-,*] operators overloading into halfp classdef (halfp_add, halfp_sub and halfp_mul were left for backwards compatibility for now)
|
|
|
1.0.2 | * support for direct 'double' or 'single' precision input arguments to the arithmetic functions.
|
||
1.0.1 | bug fixing and allowing operation with mixed size input arguments when one argument is of size 1 (e.g. [x, y, z, w]+1=[x+1, y+1, z+1, w+1]). |
||
1.0.0 |