Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
isEqualTo ($that) | |
isLessThan ($that) | |
isLessThanOrEqualTo ($that) | |
isGreaterThan ($that) | |
isGreaterThanOrEqualTo ($that) | |
isZero () | |
isNegative () | |
isNegativeOrZero () | |
isPositive () | |
isPositiveOrZero () | |
getSign () | |
compareTo ($that) | |
toBigInteger () | |
toBigDecimal () | |
toBigRational () | |
toScale (int $scale, int $roundingMode=RoundingMode::UNNECESSARY) | |
toInt () | |
toFloat () | |
__toString () | |
jsonSerialize () | |
Fonctions membres publiques statiques | |
static | of ($value) |
static | min (... $values) |
static | max (... $values) |
Fonctions membres protégées statiques | |
static | create (... $args) |
Fonctions membres privées statiques | |
static | floatToString (float $float) |
static | cleanUp (string $number) |
Attributs privés | |
const | PARSE_REGEXP |
Common interface for arbitrary-precision rational numbers.
-immutable
|
abstract |
Returns a string representation of this number.
The output of this method can be parsed by the of()
factory method; this will yield an object equal to this one, without any information loss.
Référencé par BigNumber\jsonSerialize().
|
staticprivate |
Removes optional leading zeros and + sign from the given number.
string | $number | The number, validated as a non-empty string of digits with optional sign. |
-pure
|
abstract |
Compares this number to the given one.
BigNumber | int | float | string | $that |
$this
is lower than, equal to, or greater than $that
.MathException | If the number is not valid. |
Référencé par BigNumber\isEqualTo(), BigNumber\isGreaterThan(), BigNumber\isGreaterThanOrEqualTo(), BigNumber\isLessThan(), et BigNumber\isLessThanOrEqualTo().
|
staticprotected |
Proxy method to access protected constructors from sibling classes.
-suppress TooManyArguments
Référencé par BigDecimal\getUnscaledValue(), BigInteger\toBigDecimal(), BigDecimal\toBigInteger(), BigDecimal\toBigRational(), et BigInteger\toBigRational().
|
staticprivate |
Safely converts float to string, avoiding locale-dependent issues.
float | $float |
-pure -suppress ImpureFunctionCall
Références $result.
|
abstract |
Returns the sign of this number.
Référencé par BigNumber\isNegative(), BigNumber\isNegativeOrZero(), BigNumber\isPositive(), BigNumber\isPositiveOrZero(), et BigNumber\isZero().
isEqualTo | ( | $that | ) |
Checks if this number is equal to the given one.
BigNumber | int | float | string | $that |
Références BigNumber\compareTo().
isGreaterThan | ( | $that | ) |
Checks if this number is strictly greater than the given one.
BigNumber | int | float | string | $that |
Références BigNumber\compareTo().
isGreaterThanOrEqualTo | ( | $that | ) |
Checks if this number is greater than or equal to the given one.
BigNumber | int | float | string | $that |
Références BigNumber\compareTo().
Référencé par SignedIntegerObject\createBigInteger().
isLessThan | ( | $that | ) |
Checks if this number is strictly lower than the given one.
BigNumber | int | float | string | $that |
Références BigNumber\compareTo().
Référencé par UnsignedIntegerObject\createBigInteger().
isLessThanOrEqualTo | ( | $that | ) |
Checks if this number is lower than or equal to the given one.
BigNumber | int | float | string | $that |
Références BigNumber\compareTo().
isNegative | ( | ) |
Checks if this number is strictly negative.
Références BigNumber\getSign().
Référencé par BigDecimal\abs(), BigInteger\abs(), BigInteger\getBitLength(), BigInteger\modInverse(), BigInteger\modPow(), et BigInteger\toBytes().
isNegativeOrZero | ( | ) |
isPositive | ( | ) |
isPositiveOrZero | ( | ) |
Checks if this number is positive or zero.
Références BigNumber\getSign().
Référencé par BigInteger\shiftedRight().
isZero | ( | ) |
jsonSerialize | ( | ) |
{}
Références BigNumber\__toString().
|
static |
|
static |
|
static |
Creates a BigNumber of the given value.
The concrete return type is dependent on the given value, with the following rules:
/
character are returned as BigRational.
character or using an exponential notation are returned as BigDecimal+
or -
sign are returned as BigIntegerBigNumber | int | float | string | $value |
NumberFormatException | If the format of the number is not valid. |
DivisionByZeroException | If the value represents a rational number with a denominator of zero. |
-pure
Références $value, et DivisionByZeroException\denominatorMustNotBeZero().
Référencé par BigDecimal\compareTo(), et BigInteger\compareTo().
|
abstract |
Converts this number to a BigDecimal.
RoundingNecessaryException | If this number cannot be converted to a BigDecimal without rounding. |
Référencé par BigDecimal\of().
|
abstract |
Converts this number to a BigInteger.
RoundingNecessaryException | If this number cannot be converted to a BigInteger without rounding. |
Référencé par BigInteger\of().
|
abstract |
Converts this number to a BigRational.
Référencé par BigRational\of().
|
abstract |
Returns an approximation of this number as a floating-point value.
Note that this method can discard information as the precision of a floating-point value is inherently limited.
If the number is greater than the largest representable floating point number, positive infinity is returned. If the number is less than the smallest representable floating point number, negative infinity is returned.
|
abstract |
Returns the exact value of this number as a native integer.
If this number cannot be converted to a native integer without losing precision, an exception is thrown. Note that the acceptable range for an integer depends on the platform and differs for 32-bit and 64-bit.
MathException | If this number cannot be exactly converted to a native integer. |
|
abstract |
Converts this number to a BigDecimal with the given scale, using rounding if necessary.
int | $scale | The scale of the resulting BigDecimal . |
int | $roundingMode | A RoundingMode constant. |
RoundingNecessaryException | If this number cannot be converted to the given scale without rounding. This only applies when RoundingMode::UNNECESSARY is used. |
|
private |