From: Elliot Temple Date: 2006-06-05T01:11:53+09:00 Subject: Re: Where can one find examples of masterful Ruby code? On Jun 4, 2006, at 2:47 AM, Robert Klemme wrote: > 2006/6/4, Elliot Temple : >> >> On Jun 3, 2006, at 6:17 PM, Ray Baxter wrote: >> >> > Alder Green wrote: >> > >> > 0 is a power of 2? >> >> 2^negative_infinity > > Wow, this actuall works in Ruby: > > irb(main):004:0> -1.0/0 > => -Infinity > irb(main):007:0> 2 ** (-1.0/0) > => 0.0 maybe that's a rounding error? irb(main):009:0> 2 ** (-2 ** 11) => 0.0 irb(main):008:0> 2.0 ** (-2.0 ** 11.0) => 0.0 (i'm not sure exactly how conversion to floats works, hence 2 versions) -- Elliot Temple http://www.curi.us/blog/