summaryrefslogtreecommitdiffhomepage
path: root/src/array.c
diff options
context:
space:
mode:
authormattn <[email protected]>2014-10-29 19:27:20 +0900
committermattn <[email protected]>2014-10-29 19:27:20 +0900
commiteaa0296fc57ba5288b4d72338d008d225bb1d5ae (patch)
tree2b8750d56dc8cd194d272435556ace3524229070 /src/array.c
parentcbbf84044000878a219fad47ea16dae0cc1699a3 (diff)
downloadmruby-eaa0296fc57ba5288b4d72338d008d225bb1d5ae.tar.gz
mruby-eaa0296fc57ba5288b4d72338d008d225bb1d5ae.zip
Handle Array#[float, int] Close #2626
Diffstat (limited to 'src/array.c')
-rw-r--r--src/array.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/array.c b/src/array.c
index 21c7e5d86..6f04efe84 100644
--- a/src/array.c
+++ b/src/array.c
@@ -658,6 +658,9 @@ aget_index(mrb_state *mrb, mrb_value index)
if (mrb_fixnum_p(index)) {
return mrb_fixnum(index);
}
+ else if (mrb_float_p(index)) {
+ return mrb_float(index);
+ }
else {
mrb_int i;