summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-pack/src/pack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mrbgems/mruby-pack/src/pack.c b/mrbgems/mruby-pack/src/pack.c
index 850462830..f970d9339 100644
--- a/mrbgems/mruby-pack/src/pack.c
+++ b/mrbgems/mruby-pack/src/pack.c
@@ -1127,7 +1127,8 @@ mrb_pack_pack(mrb_state *mrb, mrb_value ary)
#ifndef MRB_WITHOUT_FLOAT
} else if (type == PACK_TYPE_FLOAT) {
if (!mrb_float_p(o)) {
- o = mrb_funcall(mrb, o, "to_f", 0);
+ mrb_float f = mrb_to_flo(mrb, o);
+ o = mrb_float_value(mrb, f);
}
#endif
} else if (type == PACK_TYPE_STRING) {