lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

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 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!