Representation length of integral types

rumbu via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 3 23:18:23 PDT 2015


On Tuesday, 4 August 2015 at 06:17:15 UTC, rumbu wrote:

>
> enum max_hex_length = T.sizeof * 2;
> enum max_bin_length = T.sizeof * 8;
> enum max_dec_length = cast(T)log10(T.sizeof) + 1;

Errata:
enum max_dec_length = cast(T)log10(T.max) + 1;



More information about the Digitalmars-d mailing list