Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Add BigFloat type #15

Open
castarco opened this issue Mar 18, 2015 · 0 comments
Open

Add BigFloat type #15

castarco opened this issue Mar 18, 2015 · 0 comments

Comments

@castarco
Copy link
Contributor

Related to bug #8 . In order to allow really big numbers (with very large exponents), Decimal isn't enough, so we need to introduce a float point type.

PHP's float/double type also allows very large numbers, but exponents limits vary from 256 values to 16536 values depending on the CPU, with a BigFloat type we can work with very large exponents. This type will be slower than native the native float type, but the tradeoff is worth. The explanation about exponents it's also applicable to mantissas.

It's important to implement conversion methods 'from & to' Decimal objects in the numeric range where it's possible.

It would be nice if we implement in the Decimal type a system to detect when it's preferable to switch to BigFloat. Maybe capturing memory exhaustion exceptions and handling it?

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

No branches or pull requests

1 participant