Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept hexadecimal input #64

Open
99hops opened this issue Oct 8, 2021 · 1 comment
Open

Accept hexadecimal input #64

99hops opened this issue Oct 8, 2021 · 1 comment

Comments

@99hops
Copy link

99hops commented Oct 8, 2021

Is it possible to add support for hexadecimal input to avoid additional conversion?

Example: BigDecimal::of('0x5208')->multipliedBy('0x59682f08');

@BenMorel
Copy link
Member

BenMorel commented Oct 8, 2021

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()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants