From: Jeff Schwab Date: 2009-04-10T23:30:02+09:00 Subject: Re: Float.finite ? ITYM Float#finite? Aldric Giacomoni wrote: > How does one use .finite? effectively? > I tried with (1.0/3).finite? => true... > I tried with BigDecimal.. Still true. I'm pretty sure these numbers aren't > finite. They are finite. > How do I make this work? #finite? doesn't tell you whether the decimal (or any other) representation of a number requires finite space. #finite? tells you only whether the value is finite, i.e. not infinite. irb(main):002:0> 1.0/3.0 => 0.333333333333333 irb(main):003:0> _.finite? => true irb(main):004:0> 1.0/0 => Infinity irb(main):005:0> _.finite? => false irb(main):006:0>