in reply to Re: reliably test integer size for portable bit-fiddling? (~0)
in thread reliably test integer size for portable bit-fiddling?

I figure for base2 stuff length is better than log (no need to worry about rounding/transcendental crap), e.g.,
4*length sprintf'%x',~0

Replies are listed 'Best First'.
Re^3: reliably test integer size for portable bit-fiddling? (~0)
by BrowserUk (Patriarch) on Dec 14, 2014 at 09:46 UTC

    Avoid the multiply:

    say length sprintf "%b", ~0;; 64

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.