Numeric access to char[]

Chad J gamerChad at
Tue Aug 22 22:47:21 PDT 2006

nobody wrote:
> So you will have to do it manually. I would like to suggest that if you 
> can pad the char[] to ensure its .length % 8 == 0 then you can cast it 
> to a ulong and your shifting will be faster.

Sure about ulong?  In my spare time I made my own minimal Bignum 
implementation.  I'm not sure about shifts, but for addition with 
carrying it was faster to use size_t (uint in this case) rather than 
ulong.  I wonder if maybe the compiler could optimize it better if it 
didn't have to emulate 64 bit integers.  Or my benchmark was borked.

More information about the Digitalmars-d-learn mailing list