From: Fleck Jean-Julien Date: 2010-01-09T16:39:12+09:00 Subject: Re: Decimal in for loop? Hello Nathan, > the code above returns > > 0.0 0.1 0.2 0.3 0.4 > > How can I write this in Ruby? Use the step method for all descendant of Numeric class: >> 0.step(0.5,0.1) { |i| p i } 0.0 0.1 0.2 0.3 0.4 0.5 => 0 >> 0.1.step(0.5,0.1) { |i| p i } 0.1 0.2 0.3 0.4 0.5 => 0.1 Cheers, -- JJ Fleck PCSI1 Lycée Kléber