Shifting big numbers
问题 X = 712360810625491574981234007851998 is represented using a linked list and each node is an unsigned int Is there a fast way to do X << 8 X << 591 other than X * 2^8 X * 2^591 ? 回答1: Bit shifting is very easy in any arbitrary number of bits. Just remember to shift the overflowed bits to the next element. That's all Below is a left shift by 3 example uint64_t i1, i2, i3, o1, o2, o3; // {o3, o2, o1} = {i3, i2, i1} << 3; o3 = i3 << 3 | i2 >> (32 - 3); o2 = i2 << 3 | i1 >> (32 - 3); o1 = i1 << 3