# New Ticket Created by  Alex Jakimenko 
# Please include the string:  [perl #128035]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128035 >


Code:
say ‘a’ x 9999999999999999999

Result:
repeat count (-8446744073709551617) cannot be negative
  in block <unit> at -e line 1


What's interesting is that there is a check in place:

Code:
say ‘a’ x 999999999999999999

Result:
repeat count > 1073741824 arbitrarily unsupported...
  in block <unit> at -e line 1



Also, with even bigger numbers we get this:

Code:
say ‘a’ x 99999999999999999999

Result:
Cannot unbox 67 bit wide bigint into native integer
  in block <unit> at -e line 1



But the problem is that nqp::unbox_i returns a negative number:

Code:
use nqp; say nqp::unbox_i 9999999999999999999

Result:
-8446744073709551617


And that's probably why it is considered to be negative when using [x].


Also see this:

Code:
use nqp; say nqp::unbox_i(2 ** 64-1)

Result:
-1

Which is probably how it is supposed to work, but it looks like the check in 
[x] operator has to be done earlier.

Reply via email to