summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-10-30 10:27:05 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-10-30 10:27:05 +0900
commit5bd3d9bc27438ba4cea030a67af02db02f24785b (patch)
tree76e28bf946ccac5a95a1163246cb28bc6a94c9c4
parent69beaea2966616f0ee2c9b5f5fffe148ec477fb4 (diff)
downloadmruby-5bd3d9bc27438ba4cea030a67af02db02f24785b.tar.gz
mruby-5bd3d9bc27438ba4cea030a67af02db02f24785b.zip
add cast to return from aget_index(); ref #2627
-rw-r--r--src/array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/array.c b/src/array.c
index 6f04efe84..02cc1a83a 100644
--- a/src/array.c
+++ b/src/array.c
@@ -659,7 +659,7 @@ aget_index(mrb_state *mrb, mrb_value index)
return mrb_fixnum(index);
}
else if (mrb_float_p(index)) {
- return mrb_float(index);
+ return (mrb_int)mrb_float(index);
}
else {
mrb_int i;