Documentation

Floats
in package
uses StaticClass

Floating-point numbers comparison.

Table of Contents

Constants

Epsilon  = 1.0E-10

Methods

__callStatic()  : mixed
Call to undefined static method.
areEqual()  : bool
Returns true if $a = $b
compare()  : int
Compare two floats. If $a < $b it returns -1, if they are equal it returns 0 and if $a > $b it returns 1
isGreaterThan()  : bool
Returns true if $a > $b
isGreaterThanOrEqualTo()  : bool
Returns true if $a >= $b
isInteger()  : bool
isLessThan()  : bool
Returns true if $a < $b
isLessThanOrEqualTo()  : bool
Returns true if $a <= $b
isZero()  : bool
__construct()  : mixed
Class is static and cannot be instantiated.

Constants

Epsilon

private mixed Epsilon = 1.0E-10

Methods

__callStatic()

Call to undefined static method.

public static __callStatic(string $name, array<string|int, mixed> $args) : mixed
Parameters
$name : string
$args : array<string|int, mixed>
Tags
throws
MemberAccessException

areEqual()

Returns true if $a = $b

public static areEqual(float $a, float $b) : bool
Parameters
$a : float
$b : float
Tags
throws
LogicException

if one of parameters is NAN

Return values
bool

compare()

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

public static compare(float $a, float $b) : int
Parameters
$a : float
$b : float
Tags
throws
LogicException

if one of parameters is NAN

Return values
int

isGreaterThan()

Returns true if $a > $b

public static isGreaterThan(float $a, float $b) : bool
Parameters
$a : float
$b : float
Tags
throws
LogicException

if one of parameters is NAN

Return values
bool

isGreaterThanOrEqualTo()

Returns true if $a >= $b

public static isGreaterThanOrEqualTo(float $a, float $b) : bool
Parameters
$a : float
$b : float
Tags
throws
LogicException

if one of parameters is NAN

Return values
bool

isInteger()

public static isInteger(float $value) : bool
Parameters
$value : float
Return values
bool

isLessThan()

Returns true if $a < $b

public static isLessThan(float $a, float $b) : bool
Parameters
$a : float
$b : float
Tags
throws
LogicException

if one of parameters is NAN

Return values
bool

isLessThanOrEqualTo()

Returns true if $a <= $b

public static isLessThanOrEqualTo(float $a, float $b) : bool
Parameters
$a : float
$b : float
Tags
throws
LogicException

if one of parameters is NAN

Return values
bool

isZero()

public static isZero(float $value) : bool
Parameters
$value : float
Return values
bool

__construct()

Class is static and cannot be instantiated.

private __construct() : mixed

        
On this page

Search results