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 25
static bool isZero(float $value)

No description

Parameters

float $value

Return Value

bool

at line 31
static bool isInteger(float $value)

No description

Parameters

float $value

Return Value

bool

at line 41
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 63
static bool areEqual(float $a, float $b)

Returns true if $a = $b

Parameters

float $a
float $b

Return Value

bool

Exceptions

LogicException

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

Returns true if $a < $b

Parameters

float $a
float $b

Return Value

bool

Exceptions

LogicException

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

Returns true if $a <= $b

Parameters

float $a
float $b

Return Value

bool

Exceptions

LogicException

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

Returns true if $a > $b

Parameters

float $a
float $b

Return Value

bool

Exceptions

LogicException

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

Returns true if $a >= $b

Parameters

float $a
float $b

Return Value

bool

Exceptions

LogicException

Traits

Static class.