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
areEqual()
Returns true if $a = $b
public
static areEqual(float $a, float $b) : bool
Parameters
- $a : float
- $b : float
Tags
Return values
boolcompare()
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
Return values
intisGreaterThan()
Returns true if $a > $b
public
static isGreaterThan(float $a, float $b) : bool
Parameters
- $a : float
- $b : float
Tags
Return values
boolisGreaterThanOrEqualTo()
Returns true if $a >= $b
public
static isGreaterThanOrEqualTo(float $a, float $b) : bool
Parameters
- $a : float
- $b : float
Tags
Return values
boolisInteger()
public
static isInteger(float $value) : bool
Parameters
- $value : float
Return values
boolisLessThan()
Returns true if $a < $b
public
static isLessThan(float $a, float $b) : bool
Parameters
- $a : float
- $b : float
Tags
Return values
boolisLessThanOrEqualTo()
Returns true if $a <= $b
public
static isLessThanOrEqualTo(float $a, float $b) : bool
Parameters
- $a : float
- $b : float
Tags
Return values
boolisZero()
public
static isZero(float $value) : bool
Parameters
- $value : float
Return values
bool__construct()
Class is static and cannot be instantiated.
private
__construct() : mixed