summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2001-06-03 05:26:36 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-03 15:12:13 +0000
commit58a9a5d5decdad14b14ae7eccc5dfaa8de6eddd9 (patch)
treeffdcf7f174504129f1af2148240288e31ce814ea /handy.h
parentb11416c6dfc6192b454746d4bf2a583723270bde (diff)
downloadperl-58a9a5d5decdad14b14ae7eccc5dfaa8de6eddd9.tar.gz
Re: 'decimal digits' macro?
Message-Id: <200106030326.EAA18786@crypt.compulink.co.uk> p4raw-id: //depot/perl@10397
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/handy.h b/handy.h
index 99cb5c6e74..76cbf2e216 100644
--- a/handy.h
+++ b/handy.h
@@ -194,6 +194,7 @@ typedef U64TYPE U64;
#endif
+/* log(2) is pretty close to 0.30103, just in case anyone is grepping for it */
#define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */
#define TYPE_DIGITS(T) BIT_DIGITS(sizeof(T) * 8)
#define TYPE_CHARS(T) (TYPE_DIGITS(T) + 2) /* sign, NUL */