e$B%A%1%C%He(B #781 e$B$,99?7$5$l$^$7$?!#e(B (by tadayoshi funaba)
e$BC1$K3NG’$G$9$,!“e(Bstep
e$B$,IbF0>.?tE@?t$@$H!”:G=i$+$iIbF0>.?tE@?t$K$J$Ce(B
e$B$F$$$F!"B>$N>l9g$H0c$&$h$&$K8+$($^$9!#$3$l$O$3$&$$$&$b$N$G$9$+!#e(B
$ ./ruby -e “p 0.step(3,1.0){|x| p [x, x.class]}”
[0.0, Float]
[1.0, Float]
[2.0, Float]
[3.0, Float]
0
$ ./ruby -e “p 0.step(3,Rational(1)){|x| p [x, x.class]}”
[0, Fixnum]
[(1/1), Rational]
[(2/1), Rational]
[(3/1), Rational]
0
$ ./ruby -rbigdecimal -e “p 0.step(3,BigDecimal(‘1’)){|x| p [x,
x.class]}”
[0, Fixnum]
[#BigDecimal:81b5d48,‘0.1E1’,4(12), BigDecimal]
[#BigDecimal:81b5bcc,‘0.2E1’,4(12), BigDecimal]
[#BigDecimal:81b5adc,‘0.3E1’,4(12), BigDecimal]
0