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

I kinda like that, but eval frankly creeps me out a bit.

Replies are listed 'Best First'.
Re^4: Number too big to fit in integer
by jpl (Monk) on Dec 26, 2022 at 16:59 UTC

    Upon further reflection, $Config{nv_overflows_integers_at} doesn't tell me anything I didn't know. It still doesn't give me something I can use to determine if an argument that looks like an integer will fit in an integer. I will give it credit for obscurity, though:-)

    DB<1> use Config DB<2> say $Config{nv_overflows_integers_at} 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0

    If I eval it, I get something that is, pretty much by definition, something that won't fit in an integer. But, as we have seen, if I compare it using > to ~0, a valid integer, it may not compare high.