No such thing as a small change | |
PerlMonks |
Re^3: Number too big to fit in integerby syphilis (Archbishop) |
on Dec 27, 2022 at 13:39 UTC ( [id://11149127]=note: print w/replies, xml ) | Need Help?? |
If I am dealing with integers that can get anywhere near the safe limit (which is a lot of the time), I use a bigint library. Fair enough, but all the OP wanted was to test whether a positive integer value was greater than ~0. If you think it's fair enough that checking whether $non_negative_integer_value > ~0 should not necessarily be sufficient, then that's fine by me - you've got what you want, and you're welcome to stick with your 64-bit precision IV & 53-bit precision NV perl configuration. To me, the behaviour (re integer-float conversions) on this and only this IV/NV configuration is interesting and challenging, up to a point. But it's poorly thought out (if it was ever actually thought out at all), and having to deal with it is counter-productive. Perl is supposed to DWIM and to make things easier, and this particular configuration falls down in those 2 regards. That, nearly a quarter of the way through the 21st century this configuration is still arguably the most prevalent by far, makes me wonder about the mental acuity of perl programmers - at least those perl programmers that are interested in perl's math operations. OTOH, for all other possible IV/NV permutations perl's math behaviour (re integer-float conversions) is sane, helpful, DWIMs, and makes things easier. Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|