nupp.math.f32
IEEE-754 binary32 arithmetic with explicit rounding.
Module contents
Functions
| Function | Kind | Description |
|---|
add | function | |
div | function | |
exp | function | A deterministic polynomial exponential, clamped to [-104, 88]. |
fma | function | |
fromBF16Bits | function | Widens the low sixteen IEEE bfloat16 storage bits to binary32. |
fromBits | function | |
fromF16Bits | function | Widens IEEE binary16 storage bits to binary32, canonicalizing NaN. |
max | function | |
min | function | |
mul | function | |
narrow | function | |
round | function | |
sqrt | function | |
sub | function | |
toBF16Bits | function | Rounds binary32 to IEEE bfloat16 storage bits, ties to even. |
toBits | function | |
toF16Bits | function | Rounds binary32 to IEEE binary16 storage bits, ties to even. |
Functions
addfunction
Arguments
Returns
divfunction
Arguments
Returns
expfunction
A deterministic polynomial exponential, clamped to [-104, 88]. The specified binary32 operation sequence is shared by CPU and GPU AOT.
Arguments
| Name | Type | Description |
|---|
value | float | |
Returns
fmafunction
Arguments
Returns
fromBF16Bitsfunction
Widens the low sixteen IEEE bfloat16 storage bits to binary32.
Arguments
| Name | Type | Description |
|---|
bits | uint32 | |
Returns
fromBitsfunction
Arguments
| Name | Type | Description |
|---|
bits | uint32 | |
Returns
fromF16Bitsfunction
Widens IEEE binary16 storage bits to binary32, canonicalizing NaN.
Arguments
| Name | Type | Description |
|---|
bits | uint32 | |
Returns
maxfunction
Arguments
Returns
minfunction
Arguments
Returns
mulfunction
Arguments
Returns
narrowfunction
Arguments
| Name | Type | Description |
|---|
value | number | |
Returns
roundfunction
Arguments
| Name | Type | Description |
|---|
value | number | |
Returns
sqrtfunction
Arguments
| Name | Type | Description |
|---|
value | float | |
Returns
subfunction
Arguments
Returns
toBF16Bitsfunction
Rounds binary32 to IEEE bfloat16 storage bits, ties to even.
Arguments
| Name | Type | Description |
|---|
value | float | |
Returns
toBitsfunction
Arguments
| Name | Type | Description |
|---|
value | float | |
Returns
toF16Bitsfunction
Rounds binary32 to IEEE binary16 storage bits, ties to even.
Arguments
| Name | Type | Description |
|---|
value | float | |
Returns