mirror of
https://github.com/danog/math.git
synced 2024-11-27 04:14:40 +01:00
Add __toString() to the BigNumber interface
This commit is contained in:
parent
ade40b841b
commit
2619c02fd6
@ -805,9 +805,7 @@ class BigDecimal implements BigNumber, \Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of this number.
|
||||
*
|
||||
* @return string
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
|
@ -638,7 +638,7 @@ class BigInteger implements BigNumber, \Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
|
@ -8,6 +8,8 @@ namespace Brick\Math;
|
||||
interface BigNumber
|
||||
{
|
||||
/**
|
||||
* Converts this number to a BigInteger.
|
||||
*
|
||||
* @return BigInteger
|
||||
*
|
||||
* @throws ArithmeticException If this number cannot be safely converted to a BigInteger.
|
||||
@ -15,6 +17,8 @@ interface BigNumber
|
||||
public function toBigInteger();
|
||||
|
||||
/**
|
||||
* Converts this number to a BigDecimal.
|
||||
*
|
||||
* @return BigDecimal
|
||||
*
|
||||
* @throws ArithmeticException If this number cannot be safely converted to a BigDecimal.
|
||||
@ -22,7 +26,16 @@ interface BigNumber
|
||||
public function toBigDecimal();
|
||||
|
||||
/**
|
||||
* Converts this number to a BigRational.
|
||||
*
|
||||
* @return BigRational
|
||||
*/
|
||||
public function toBigRational();
|
||||
|
||||
/**
|
||||
* Returns a string representation of this number.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString();
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ class BigRational implements BigNumber, \Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user