module Data.Bits

Alastair Reid alastair at reid-consulting-uk.ltd.uk
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}.

A



More information about the FFI mailing list