Float32

GitHub   Edit on GitHub

Utilities for working with the Float32 type.

Added in 0.2.0 No other changes yet.
1
import Float32 from "float32"

Constants

Float32 constant values.

Float32.infinity

Added in 0.4.0 No other changes yet.
1
infinity : Float32

Infinity represented as a Float32 value.

Float32.nan

Added in 0.4.0 No other changes yet.
1
nan : Float32

NaN (Not a Number) represented as a Float32 value.

Float32.pi

Added in 0.5.2 No other changes yet.
1
pi : Float32

Pi represented as a Float32 value.

Float32.tau

Added in 0.5.2 No other changes yet.
1
tau : Float32

Tau represented as a Float32 value.

Float32.e

Added in 0.5.2 No other changes yet.
1
e : Float32

Euler’s number represented as a Float32 value.


Conversions

Functions for converting between Numbers and the Float32 type.

Float32.fromNumber

Added in 0.2.0 No other changes yet.
1
fromNumber : Number -> Float32

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.
1
toNumber : Float32 -> Number

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

Operations

Mathematical operations for Float32 values.

Float32.add

Added in 0.2.0 No other changes yet.
1
add : (Float32, Float32) -> Float32

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

Float32.sub

Added in 0.2.0 No other changes yet.
1
sub : (Float32, Float32) -> Float32

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

Float32.mul

Added in 0.2.0 No other changes yet.
1
mul : (Float32, Float32) -> Float32

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

Float32.div

Added in 0.2.0 No other changes yet.
1
div : (Float32, Float32) -> Float32

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

Comparisons

Functions for comparing Float32 values.

Float32.lt

Added in 0.2.0 No other changes yet.
1
lt : (Float32, Float32) -> Bool

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

Float32.gt

Added in 0.2.0 No other changes yet.
1
gt : (Float32, Float32) -> Bool

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

Float32.lte

Added in 0.2.0 No other changes yet.
1
lte : (Float32, Float32) -> Bool

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

Float32.gte

Added in 0.2.0 No other changes yet.
1
gte : (Float32, Float32) -> Bool

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
This is a notification!