math
math copied to clipboard
Accept hexadecimal input
Is it possible to add support for hexadecimal input to avoid additional conversion?
Example: BigDecimal::of('0x5208')->multipliedBy('0x59682f08');
Hi,
I'm not sure if it makes sense to add more convenience formats in of(): it already accepts multiple formats to cover the needs of the 3 number classes (BigInteger, BigDecimal, BigRational), and accepting hexadecimal is opening the Pandora box: should we accept 0b afterwards?
Is it really a big issue to call BigInteger::fromBase()?