php-bignumbers icon indicating copy to clipboard operation
php-bignumbers copied to clipboard

Long exponential part causes an error

Open silentvick opened this issue 10 years ago • 1 comments

I noticed that there is no size check of exponential part. If I pass something like this:

1.33E+3333333333333333333333

It will cause "Allowed memory size exhausted" error.

silentvick avatar Jan 23 '15 18:01 silentvick

Hello @silentvick , thanks for your bug report.

That's true, the problem is related with the inner representation. We need to think a good way to decouple the inner representation from the Decimal object in order too allow numbers with really big exponents.

The problem is that php-bignumbers is designed to offer good precision, and it's not trivial to decide the point where jump from fixed point to floating point representation.

Do you have any suggestion?

castarco avatar Mar 08 '15 11:03 castarco