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

2021-08-20 Thread Peter John Acklam
tor. 19. aug. 2021 kl. 16:40 skrev Dan Book : > > > Truncation to integer seems the most useful and expected behavior to me. Not sure if the "overloading of constants" case should be affected, would people depend on it staying unmodified? I agree on truncation to integer. This is consistent with h

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: > > $