Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Number too big to fit in integer

by syphilis (Archbishop)
on Dec 27, 2022 at 13:39 UTC ( [id://11149127]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Number too big to fit in integer
in thread Number too big to fit in integer

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

Replies are listed 'Best First'.
Re^4: Number too big to fit in integer
by hv (Prior) on Dec 27, 2022 at 14:16 UTC

    makes me wonder about the mental acuity of perl programmers

    That's twice now that you have stated anyone who doesn't care about the same things as you do, in the same way, must be stupid. Please stop doing that.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11149127]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-24 08:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found