[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua BitOp 1.0.0 released
- From: Mike Pall <mikelu-0812@...>
- Date: Wed, 17 Dec 2008 16:38:52 +0100
Doug Currie wrote:
> I notice that you use ((SBits)b >> n) to implement bit.arshift. C89 and C99
> don't specify how signed right shifts are performed; it is
> "implementation-defined behavior." It seems that to insure the operational
> semantics you specify, either a more robust implementation for arshift is
> needed (as in my Plea at http://lua-users.org/wiki/BitwiseOperators) or at
> least an arshift test should be added at initialization.
All C implementations on two's complement machines I've ever seen
'do the right thing'. Too many programs would break otherwise.
I guess I'll just add a self-test in the next version. Thank you!