summaryrefslogtreecommitdiffhomepage
path: root/include
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 /include
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 'include')
-rw-r--r--include/mruby/numeric.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mruby/numeric.h b/include/mruby/numeric.h
index d670504c2..34707e441 100644
--- a/include/mruby/numeric.h
+++ b/include/mruby/numeric.h
@@ -34,6 +34,7 @@ MRB_API mrb_value mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, mrb_int base);
#ifndef MRB_WITHOUT_FLOAT
MRB_API mrb_value mrb_float_to_str(mrb_state *mrb, mrb_value x, const char *fmt);
MRB_API mrb_float mrb_to_flo(mrb_state *mrb, mrb_value x);
+MRB_API mrb_value mrb_int_value(mrb_state *mrb, mrb_float f);
#endif
MRB_API mrb_value mrb_num_plus(mrb_state *mrb, mrb_value x, mrb_value y);