[go-nuts] Re: math integer sizes

2018-02-25 Thread Jason Gade
Thanks! That is very helpful. On Saturday, February 24, 2018 at 4:52:38 AM UTC-8, Stefan Nilsson wrote: > > I don't know why it's not part of the standard library, but here is a > piece of code that does the job. (It's written in a slightly roundabout way > to make sure that the constants are

[go-nuts] Re: math integer sizes

2018-02-24 Thread Stefan Nilsson
I don't know why it's not part of the standard library, but here is a piece of code that does the job. (It's written in a slightly roundabout way to make sure that the constants are untyped.) const BitsPerWord = 32 << (^uint(0) >> 63) // either 32 or 64 const ( MaxInt =