RosettaCodeData/Task/Exponentiation-operator/Ruby/exponentiation-operator-3.rb
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

22 lines
227 B
Ruby

class Fixnum
def **(m)
print "Fixnum "
pow(m)
end
end
class Bignum
def **(m)
print "Bignum "
pow(m)
end
end
class Float
def **(m)
print "Float "
pow(m)
end
end
p i=2**64
p i ** 2
p 2.2 ** 3