[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua BitOp 1.0.0 released
- From: Doug Currie <doug.currie@...>
- Date: Wed, 17 Dec 2008 10:26:07 -0500
On Dec 17, 2008, at 10:12 AM, Mike Pall wrote:
The hope is that with Lua 5.2 we get a "bit" library in the core
distribution. Consider the Lua BitOp docs, and in particular the
section on operational semantics and rationale as my contribution
to this effort.
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.