Skip to content

Commit

Permalink
[DOC] Update comment for DECIMAL_SIZE_OF_BITS
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Nov 11, 2023
1 parent 9eac9d7 commit 64f0346
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/ruby/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 64f0346

Please sign in to comment.