summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/numeric.c b/numeric.c
index 01dadb8471..3d97c52181 100644
--- a/numeric.c
+++ b/numeric.c
@@ -805,12 +805,12 @@ num_step(argc, argv, from)
long i = 0;
if (unit > 0) {
- for (i=0; n<=end; i++, n=unit*i+beg) {
+ for (i=0; n<=end; i++, n=beg+unit*i) {
rb_yield(rb_float_new(n));
}
}
else {
- for (i=0; n>=end; i++, n=unit*i+beg) {
+ for (i=0; n>=end; i++, n=beg+unit*i) {
rb_yield(rb_float_new(n));
}
}