Actions
Bug #5713
closedFixnum#** returns Infinity for 0 ** negative Bignum
Description
=begin
Instead it should raise ZeroDivisionError, the same as negative Fixnums.
wordsize = 8 * 1.size
fixnum_min = -2 ** (wordsize - 2)
def zero_power(exp)
0 ** exp
rescue ZeroDivisionError
"ZeroDivisionError"
end
[-1, fixnum_min, (fixnum_min-1)].each {|i| puts zero_power(i)}
=end
Actions
Like0
Like0Like0Like0Like0Like0Like0