Sha256: 1cc758d9098a86f0d0a94f372d1b9fd13b28b5bf60b845f08d19be261947d5c6
Contents?: true
Size: 434 Bytes
Versions: 16
Compression:
Stored size: 434 Bytes
Contents
# Alternate "safer" versions of Ruby methods. Mostly non-blocking. [Fixnum, Bignum, Float].each do |klass| klass.class_eval do # A very weak version of pow, it doesn't work on Floats, but it's gonna # fill the most common uses for now. def **(x) case x when 0; 1 when 1; self else y = 1 while 0 <= (x -= 1) do y *= self end y end end end end
Version data entries
16 entries across 16 versions & 3 rubygems