summaryrefslogtreecommitdiffhomepage
path: root/src/numeric.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-05-21 16:08:02 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-05-21 21:08:26 +0900
commite941cf06a3e0351107d36d49d540562fdf49f9b4 (patch)
tree4afaa5277089308f7daf985c3db39047f0efcf82 /src/numeric.c
parentf6e4145ad960d9bc748f9c91fd4c5db5afeebbd0 (diff)
downloadmruby-e941cf06a3e0351107d36d49d540562fdf49f9b4.tar.gz
mruby-e941cf06a3e0351107d36d49d540562fdf49f9b4.zip
Export `mrb_int_value` that converts `mrb_float` to `Fixnum`.
Or `Float` if `mrb_float` value is too big (or too small) to fit in `mrb_int`. The `_int_` in `mrb_int_value` means `Integral` module, which represents integer-like values in mruby.
Diffstat (limited to 'src/numeric.c')
-rw-r--r--src/numeric.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/numeric.c b/src/numeric.c
index 140cd0101..e15b7f671 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -45,7 +45,7 @@ mrb_to_flo(mrb_state *mrb, mrb_value val)
return mrb_float(val);
}
-static mrb_value
+MRB_API mrb_value
mrb_int_value(mrb_state *mrb, mrb_float f)
{
if (FIXABLE_FLOAT(f)) {