summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'random.c')
-rw-r--r--random.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/random.c b/random.c
index a1fb3a8..b36784c 100644
--- a/random.c
+++ b/random.c
@@ -1122,8 +1122,7 @@ rand_range(struct MT* mt, VALUE range)
case T_FLOAT: {
VALUE f = rb_check_to_float(beg);
if (!NIL_P(f)) {
- RFLOAT_VALUE(v) += RFLOAT_VALUE(f);
- return v;
+ return DBL2NUM(RFLOAT_VALUE(v) + RFLOAT_VALUE(f));
}
}
default: