Float32
Edit on GitHubUtilities for working with the Float32 type.
Added in 0.2.0
No other changes yet.
Values
Functions and constants included in the Float32 module.
Float32.infinity
Added in 0.4.0
No other changes yet.
Infinity represented as a Float32 value.
This is an alternative to the Infinityf
literal.
Float32.nan
Added in 0.4.0
No other changes yet.
NaN (Not a Number) represented as a Float32 value.
This is an alternative to the NaNf
literal.
Float32.pi
Added in 0.5.2
No other changes yet.
Pi represented as a Float32 value.
Float32.tau
Added in 0.5.2
No other changes yet.
Tau represented as a Float32 value.
Float32.e
Added in 0.5.2
No other changes yet.
Euler’s number represented as a Float32 value.
Float32.fromNumber
Added in 0.2.0
No other changes yet.
Converts a Number to a Float32.
Parameters:
param | type | description |
---|---|---|
number |
Number |
The value to convert |
Returns:
type | description |
---|---|
Float32 |
The Number represented as a Float32 |
Float32.toNumber
Added in 0.2.0
No other changes yet.
Converts a Float32 to a Number.
Parameters:
param | type | description |
---|---|---|
float |
Float32 |
The value to convert |
Returns:
type | description |
---|---|
Number |
The Float32 represented as a Number |
Float32.(+)
Added in 0.6.0
version | changes |
---|---|
0.2.0 | Originally named `add` |
Computes the sum of its operands.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The first operand |
y |
Float32 |
The second operand |
Returns:
type | description |
---|---|
Float32 |
The sum of the two operands |
Examples:
Float32.(-)
Added in 0.6.0
version | changes |
---|---|
0.2.0 | Originally named `sub` |
Computes the difference of its operands.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The first operand |
y |
Float32 |
The second operand |
Returns:
type | description |
---|---|
Float32 |
The difference of the two operands |
Examples:
Float32.(*)
Added in 0.6.0
version | changes |
---|---|
0.2.0 | Originally named `mul` |
Computes the product of its operands.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The first operand |
y |
Float32 |
The second operand |
Returns:
type | description |
---|---|
Float32 |
The product of the two operands |
Examples:
Float32.(/)
Added in 0.6.0
version | changes |
---|---|
0.2.0 | Originally named `div` |
Computes the quotient of its operands.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The first operand |
y |
Float32 |
The second operand |
Returns:
type | description |
---|---|
Float32 |
The quotient of the two operands |
Examples:
Float32.(<)
Added in 0.6.0
version | changes |
---|---|
0.2.0 | Originally named `lt` |
Checks if the first value is less than the second value.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The first value |
y |
Float32 |
The second value |
Returns:
type | description |
---|---|
Bool |
true if the first value is less than the second value or false otherwise |
Examples:
Float32.(>)
Added in 0.6.0
version | changes |
---|---|
0.2.0 | Originally named `gt` |
Checks if the first value is greater than the second value.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The first value |
y |
Float32 |
The second value |
Returns:
type | description |
---|---|
Bool |
true if the first value is greater than the second value or false otherwise |
Examples:
Float32.(<=)
Added in 0.6.0
version | changes |
---|---|
0.2.0 | Originally named `lte` |
Checks if the first value is less than or equal to the second value.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The first value |
y |
Float32 |
The second value |
Returns:
type | description |
---|---|
Bool |
true if the first value is less than or equal to the second value or false otherwise |
Examples:
Float32.(>=)
Added in 0.6.0
version | changes |
---|---|
0.2.0 | Originally named `gte` |
Checks if the first value is greater than or equal to the second value.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The first value |
y |
Float32 |
The second value |
Returns:
type | description |
---|---|
Bool |
true if the first value is greater than or equal to the second value or false otherwise |
Examples:
Float32.isNaN
Added in 0.6.5
No other changes yet.
Checks if the value is a float NaN value (Not A Number).
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The value to check |
Returns:
type | description |
---|---|
Bool |
true if the value is NaN, otherwise false |
Examples:
Float32.isInfinite
Added in 0.6.5
No other changes yet.
Checks if a float is infinite, that is either of positive or negative infinity.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The value to check |
Returns:
type | description |
---|---|
Bool |
true if the value is infinite or false otherwise |
Examples:
Float32.abs
Added in 0.6.5
No other changes yet.
Returns the absolute value. That is, it returns x
if x
is positive or zero and the negation of x
if x
is negative.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The operand |
Returns:
type | description |
---|---|
Float32 |
The absolute value of the operand |
Examples:
Float32.neg
Added in 0.6.5
No other changes yet.
Returns the negation of its operand.
Parameters:
param | type | description |
---|---|---|
x |
Float32 |
The operand |
Returns:
type | description |
---|---|
Float32 |
The negated operand |
Examples: