Re: Math::BigInt and bigint with non-integers

2021-08-19 Thread Timothe Litt
Consistency is good. A case could be made for either truncating to integer, or rounding to integer. I'm inclined toward round - since int() is a builtin (round isn't), which makes it easy to get the truncate behavior.  And one is more likely to get a mathematically sensible result. On the other

Re: Math::BigInt and bigint with non-integers

2021-08-19 Thread Dan Book
On Thu, Aug 19, 2021 at 4:18 AM Peter John Acklam wrote: > Hi! > > I would like some input on how the Math::BigInt module and bigint pragma > should handle non-integers. The current behaviour is rather inconsistent. > > The new() constructor converts a non-integer to a Math::BigInt NaN: > > $

Math::BigInt and bigint with non-integers

2021-08-19 Thread Peter John Acklam
Hi! I would like some input on how the Math::BigInt module and bigint pragma should handle non-integers. The current behaviour is rather inconsistent. The new() constructor converts a non-integer to a Math::BigInt NaN: $ perl -MMath::BigInt -wle 'print Math::BigInt -> new("3.16")' NaN A