Bitwise shift on big.Int?


Bitwise shift on big.Int?

Maybe this is a stupid question, but is it possible to bitwise shift a big.Int using the << and >> operators?

I'm trying to do http://ift.tt/1nEG45n in Go (for the !!FUN!! of it), but doing big.NewInt(6074001000) << 2015 gives the error invalid operation: big.NewInt(6074001000) << 2015 (shift of type *big.Int) (The magic number 2015 is just 2048-33 as shown in Wikipedia's example.)

Submitted June 12, 2017 at 11:50PM by magi093
via reddit http://ift.tt/2sfLx8S

Advertisements