mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Global renaming regarding integer and float.
Consistent number conversion function names: * `mrb_value` to immediate (C) value * `mrb_int()` -> `mrb_as_int()` * `mrb_to_flo()` -> `mrb_as_float()` * `mrb_value` to `mrb_value` (converted) * `mrb_to_int()' * `mrb_Integer()` - removed * `mrb_Float()` -> `mrb_to_float` Consistent function name (avoid `_flo` suffix): * `mrb_div_flo()` -> `mrb_div_float`
This commit is contained in:
@@ -36,6 +36,9 @@ MRB_API mrb_value mrb_num_mul(mrb_state *mrb, mrb_value x, mrb_value y);
|
||||
|
||||
MRB_API mrb_value mrb_integer_to_str(mrb_state *mrb, mrb_value x, mrb_int base);
|
||||
|
||||
/* internal function(s) */
|
||||
mrb_int mrb_div_int(mrb_state *mrb, mrb_int x, mrb_int y);
|
||||
|
||||
/* obsolete function(s); will be removed */
|
||||
#define mrb_fixnum_to_str(mrb, x, base) mrb_integer_to_str(mrb, x, base)
|
||||
|
||||
@@ -161,10 +164,14 @@ MRB_API mrb_value mrb_float_to_integer(mrb_state *mrb, mrb_value val);
|
||||
MRB_API mrb_value mrb_float_to_str(mrb_state *mrb, mrb_value x, const char *fmt);
|
||||
/* ArgumentError if format string doesn't match /%(\.[0-9]+)?[aAeEfFgG]/ */
|
||||
MRB_API int mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_float f);
|
||||
MRB_API mrb_float mrb_to_flo(mrb_state *mrb, mrb_value x);
|
||||
MRB_API mrb_float mrb_as_float(mrb_state *mrb, mrb_value x);
|
||||
|
||||
/* internal function(s) */
|
||||
mrb_float mrb_div_float(mrb_float x, mrb_float y);
|
||||
|
||||
/* obsolete function(s); will be removed */
|
||||
#define mrb_flo_to_fixnum(mrb, val) mrb_float_to_integer(mrb, val)
|
||||
#define mrb_to_flo(mrb, x) mrb_as_float(mrb, x)
|
||||
|
||||
#endif /* MRB_NO_FLOAT */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user