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
local add: @nosuspend function(a: float, b: float): float
Arguments
| Name | Type | Description |
|---|
a | float | |
b | float | |
Returns
divfunction
local div: @nosuspend function(a: float, b: float): float
Arguments
| Name | Type | Description |
|---|
a | float | |
b | float | |
Returns
expfunction
local exp: @nosuspend function(value: float): float
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
local fma: @nosuspend function(a: float, b: float, c: float): float
Arguments
| Name | Type | Description |
|---|
a | float | |
b | float | |
c | float | |
Returns
fromBF16Bitsfunction
Widens the low sixteen IEEE bfloat16 storage bits to binary32.
Arguments
Returns
fromBitsfunction
Arguments
Returns
fromF16Bitsfunction
Widens IEEE binary16 storage bits to binary32, canonicalizing NaN.
Arguments
Returns
maxfunction
local max: @nosuspend function(a: float, b: float): float
Arguments
| Name | Type | Description |
|---|
a | float | |
b | float | |
Returns
minfunction
local min: @nosuspend function(a: float, b: float): float
Arguments
| Name | Type | Description |
|---|
a | float | |
b | float | |
Returns
mulfunction
local mul: @nosuspend function(a: float, b: float): float
Arguments
| Name | Type | Description |
|---|
a | float | |
b | float | |
Returns
narrowfunction
local narrow: @nosuspend function(value: number): float
Arguments
| Name | Type | Description |
|---|
value | number | |
Returns
roundfunction
local round: @nosuspend function(value: number): float
Arguments
| Name | Type | Description |
|---|
value | number | |
Returns
sqrtfunction
local sqrt: @nosuspend function(value: float): float
Arguments
| Name | Type | Description |
|---|
value | float | |
Returns
subfunction
local sub: @nosuspend function(a: float, b: float): float
Arguments
| Name | Type | Description |
|---|
a | float | |
b | float | |
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