class Floats

Floating-point numbers comparison.

Constants

private Epsilon

Methods

static bool
isZero(float $value)

No description

static bool
isInteger(float $value)

No description

static int
compare(float $a, float $b)

Compare two floats. If $a < $b it returns -1, if they are equal it returns 0 and if $a > $b it returns 1

static bool
areEqual(float $a, float $b)

Returns true if $a = $b

static bool
isLessThan(float $a, float $b)

Returns true if $a < $b

static bool
isLessThanOrEqualTo(float $a, float $b)

Returns true if $a <= $b

static bool
isGreaterThan(float $a, float $b)

Returns true if $a > $b

static bool
isGreaterThanOrEqualTo(float $a, float $b)

Returns true if $a >= $b

Details

at line 24
static bool isZero(float $value)

No description

Parameters

float $value

Return Value

bool

at line 30
static bool isInteger(float $value)

No description

Parameters

float $value

Return Value

bool

at line 40
static int compare(float $a, float $b)

Compare two floats. If $a < $b it returns -1, if they are equal it returns 0 and if $a > $b it returns 1

Parameters

float $a
float $b

Return Value

int

Exceptions

LogicException

at line 62
static bool areEqual(float $a, float $b)

Returns true if $a = $b

Parameters

float $a
float $b

Return Value

bool

Exceptions

LogicException

at line 72
static bool isLessThan(float $a, float $b)

Returns true if $a < $b

Parameters

float $a
float $b

Return Value

bool

Exceptions

LogicException

at line 82
static bool isLessThanOrEqualTo(float $a, float $b)

Returns true if $a <= $b

Parameters

float $a
float $b

Return Value

bool

Exceptions

LogicException

at line 92
static bool isGreaterThan(float $a, float $b)

Returns true if $a > $b

Parameters

float $a
float $b

Return Value

bool

Exceptions

LogicException

at line 102
static bool isGreaterThanOrEqualTo(float $a, float $b)

Returns true if $a >= $b

Parameters

float $a
float $b

Return Value

bool

Exceptions

LogicException

Traits

Prevents instantiation.