Coder-Spirit / php-bignumbers

A robust library to handle immutable big numbers inside PHP applications
MIT License
131 stars 29 forks source link

Exponential notation validation #7

Closed silentvick closed 9 years ago

silentvick commented 9 years ago

Hello!

The Decimal class throws an exception on numbers like these:

1.048576E+06 // leading zero
3.14E+00     // just zero

But it's a valid form. So I think they should be handled well.

castarco commented 9 years ago

Hi @silentvick , I haven't touched this code since long ago, and I don't remember exactly what assumptions I've made... I should take a look on this.

I'll be thankful if you split this issue into two issues, since the big exponential problem is a completely different problem.

Have you any proposal to fix any of these problems?

P.D.: Long time ago I though on creating a new, more general and cleaner library to handle more number types in a more rigorous way (I want to carefully split the number types of their representations). The repository exists, it's called "MagicTheorist", but i can't find time to do it :( .

silentvick commented 9 years ago

@castarco , I've split issues, sorry for that.

I'll look into fix. It shouldn't be too difficult.