diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-10-04 18:10:41 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-10-14 19:23:25 +0900 |
commit | 5ccb625fbbd1e774636a9fdbe0bf1c3d38e085d5 (patch) | |
tree | 23a8d2af84fed1b1f080953a5a1eab0b73c3ea8e /numeric.c | |
parent | ee8bcbf40578c0c4e60063a3e0c86439a6891131 (diff) |
Use `roomof` macro for rounding up divisions
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1055,7 +1055,7 @@ flo_to_s(VALUE flt) { enum {decimal_mant = DBL_MANT_DIG-DBL_DIG}; enum {float_dig = DBL_DIG+1}; - char buf[float_dig + (decimal_mant + CHAR_BIT - 1) / CHAR_BIT + 10]; + char buf[float_dig + roomof(decimal_mant, CHAR_BIT) + 10]; double value = RFLOAT_VALUE(flt); VALUE s; char *p, *e; |