in reply to Number too big to fit in integer

Perhaps this will help?

$ perl -le'print "oops!" if $ARGV[ 0 ] ne sprintf "%u", $ARGV[ 0 ]' 1 +8446744073709551615 $ perl -le'print "oops!" if $ARGV[ 0 ] ne sprintf "%u", $ARGV[ 0 ]' 1 +8446744073709551616 oops!

Replies are listed 'Best First'.
Re^2: Number too big to fit in integer
by jpl (Monk) on Dec 25, 2022 at 00:18 UTC

    That crossed my mind, but perl can be too clever about tweaking arguments. Some additional debugging stuff:

    DB<169> $av0="07090" DB<170> say sprintf("%u", $av0) 7090 DB<171> say "too big?" if ($av0 ne sprintf("%u", $av0)) too big?

      If you are expecting "non-negative integers" the leading zero is superfluous anyway.

      And depending on processing could be interpreted as an octal number.