summaryrefslogtreecommitdiff
path: root/include/ruby/util.h
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-11-11 18:49:19 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-11-11 19:26:13 +0900
commit64f03460bae489b94684c6b0aa16e5a19e06f836 (patch)
tree03a364e89b4abf917f8a8dc56e79d9bf628aeb79 /include/ruby/util.h
parent9eac9d71786a8dbec520d0541a91149f01adf8ea (diff)
[DOC] Update comment for `DECIMAL_SIZE_OF_BITS`
Diffstat (limited to 'include/ruby/util.h')
-rw-r--r--include/ruby/util.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/ruby/util.h b/include/ruby/util.h
index ee11bc940a..12e69c4b80 100644
--- a/include/ruby/util.h
+++ b/include/ruby/util.h
@@ -33,7 +33,9 @@
RBIMPL_SYMBOL_EXPORT_BEGIN()
-/** an approximation of ceil(n * log10(2)), up to 65536 at least */
+/** an approximation of ceil(n * log10(2)), up to 1,048,576 (1<<20)
+ * without overflow within 32-bit calculation
+ */
#define DECIMAL_SIZE_OF_BITS(n) (((n) * 3010 + 9998) / 9999)
/** an approximation of decimal representation size for n-bytes */