aboutsummaryrefslogtreecommitdiffstats
path: root/include/ruby/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/util.h')
-rw-r--r--include/ruby/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/ruby/util.h b/include/ruby/util.h
index 5be5f2e0b4..8443af74d9 100644
--- a/include/ruby/util.h
+++ b/include/ruby/util.h
@@ -47,6 +47,9 @@ extern "C" {
RUBY_SYMBOL_EXPORT_BEGIN
+#define DECIMAL_SIZE_OF_BITS(n) (((n) * 3010 + 9998) / 9999)
+/* an approximation of ceil(n * log10(2)), upto 65536 at least */
+
#define scan_oct(s,l,e) ((int)ruby_scan_oct((s),(l),(e)))
unsigned long ruby_scan_oct(const char *, size_t, size_t *);
#define scan_hex(s,l,e) ((int)ruby_scan_hex((s),(l),(e)))