FiniteFloat32Module
PackageReified.Refinements
Operations over single-precision floats that are known to be finite.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| constraint' | FiniteFloat32.constraint' | The portable constraint admitting only finite single-precision floats. |
| refinement | FiniteFloat32.refinement | No description available. |
| value | FiniteFloat32.value input | Returns the underlying value. |
| create | FiniteFloat32.create value | Admits a finite single-precision float. |
| ofFloat32 | FiniteFloat32.ofFloat32 value | Returns the finite value, or None when it is infinite or NaN. |
| negate | FiniteFloat32.negate input | Negates the value. |
| abs | FiniteFloat32.abs input | Returns the magnitude. |
| min | FiniteFloat32.min left right | Returns the smaller value. |
| max | FiniteFloat32.max left right | Returns the larger value. |
| toFiniteFloat | FiniteFloat32.toFiniteFloat input | Widens to double precision. |
| zero | FiniteFloat32.zero | The additive identity. |
| one | FiniteFloat32.one | The multiplicative identity. |
| compare | FiniteFloat32.compare left right | Compares two finite singles. |
| sum | FiniteFloat32.sum values | Totals a non-empty list, failing when the total leaves the finite range. |
| minimum | FiniteFloat32.minimum values | Returns the smallest value. |
| maximum | FiniteFloat32.maximum values | Returns the largest value. |
The portable constraint admitting only finite single-precision floats.
Returns
Constraint<float32>
Returns the underlying value.
Parameters
| Name | Type | Description |
|---|---|---|
| input | FiniteFloat32 |
Returns
float32
Admits a finite single-precision float.
Parameters
| Name | Type | Description |
|---|---|---|
| value | float32 |
Returns
Result<FiniteFloat32, Violation>
Returns the finite value, or
None when it is infinite or NaN.Parameters
| Name | Type | Description |
|---|---|---|
| value | float32 |
Returns
FiniteFloat32 option
Negates the value. Total.
Parameters
| Name | Type | Description |
|---|---|---|
| input | FiniteFloat32 |
Returns
FiniteFloat32
Returns the magnitude. Total.
Parameters
| Name | Type | Description |
|---|---|---|
| input | FiniteFloat32 |
Returns
FiniteFloat32
Returns the smaller value. Total.
Parameters
| Name | Type | Description |
|---|---|---|
| left | FiniteFloat32 | |
| right | FiniteFloat32 |
Returns
FiniteFloat32
Returns the larger value. Total.
Parameters
| Name | Type | Description |
|---|---|---|
| left | FiniteFloat32 | |
| right | FiniteFloat32 |
Returns
FiniteFloat32
Widens to double precision. Total — every finite single is a finite double.
Parameters
| Name | Type | Description |
|---|---|---|
| input | FiniteFloat32 |
Returns
FiniteFloat
Compares two finite singles. Total and lawful, unlike comparison on
float32.Parameters
| Name | Type | Description |
|---|---|---|
| left | FiniteFloat32 | |
| right | FiniteFloat32 |
Returns
int
Totals a non-empty list, failing when the total leaves the finite range.
Parameters
| Name | Type | Description |
|---|---|---|
| values | NonEmptyList<FiniteFloat32> |
Returns
Result<FiniteFloat32, Violation>
Returns the smallest value. Total, because ordering is lawful.
Parameters
| Name | Type | Description |
|---|---|---|
| values | NonEmptyList<FiniteFloat32> |
Returns
FiniteFloat32