diff options
author | Karl Williamson <khw@cpan.org> | 2020-05-30 19:52:51 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-07-17 22:22:09 -0600 |
commit | ab350cbd30297533ca6b5ad84e705bdccf1332d5 (patch) | |
tree | 44dd589c9080a1ba52154d25e4bfbb091af4a086 /handy.h | |
parent | aae9ca421631baa3b79b7bb1d29eb19c22b02257 (diff) | |
download | perl-ab350cbd30297533ca6b5ad84e705bdccf1332d5.tar.gz |
handy.h: Add comments
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -244,7 +244,10 @@ typedef U64TYPE U64; #endif /* log(2) (i.e., log base 10 of 2) is pretty close to 0.30103, just in case - * anyone is grepping for it */ + * anyone is grepping for it. So BIT_DIGITS gives the number of decimal digits + * required to represent any possible unsigned number containing N bits. + * TYPE_DIGITS gives the number of decimal digits required to represent any + * possible unsigned number of type T. */ #define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log10(2) =~ 146/485 */ #define TYPE_DIGITS(T) BIT_DIGITS(sizeof(T) * 8) #define TYPE_CHARS(T) (TYPE_DIGITS(T) + 2) /* sign, NUL */ |