module Data.Bits

Alastair Reid alastair at
Mon Sep 9 10:28:30 EDT 2002

> The FFI spec says that the operations called 'shift' and 'rotate',
> shift and rotate their argument to the right.  However, the GHC
> implementation in CVS shifts and rotates to the left, and is
> documented to do so.

> Who is right?  FWIW, before I read any documentation I expected the
> undecorated forms to be rightward.

They shift to the left as in C, etc.

This makes the specification come out nice and clean - you're
multiplying the number by 2^n instead of 2^{-n}.


More information about the FFI mailing list