diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-08-27 10:52:02 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-08-27 12:41:30 +0900 |
commit | 04be8e84db1cf4f8b2a7bc7679eda4336da75d43 (patch) | |
tree | c7914614f4a5cf91109f7893b87ff9e5d143ad0e /numeric.c | |
parent | 37114673623c4d2b1d9f2c2ddfffba070b2d96e6 (diff) |
Use C99-defined macros to classify a floating-point number
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4783
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -1699,15 +1699,7 @@ rb_flo_is_finite_p(VALUE num) { double value = RFLOAT_VALUE(num); -#ifdef HAVE_ISFINITE - if (!isfinite(value)) - return Qfalse; -#else - if (isinf(value) || isnan(value)) - return Qfalse; -#endif - - return Qtrue; + return RBOOL(isfinite(value)); } static VALUE |