Integers to Ints

Fergus Henderson fjh@cs.mu.oz.au
Wed, 16 May 2001 22:27:18 +1000


On 16-May-2001, Steinitz, Dominic J <Dominic.J.Steinitz@BritishAirways.com> wrote:
> Can someone explain the following behaviour? Or is it a bug in hugs?

It looks to me very much like it is a bug in Hugs.

ghc 4.04 does not suffer from this bug.

It's easy to make mistakes like this, which can often arise from forgetting
the assymetric nature of twos-complement signed integers, which have more
negative numbers than positive numbers.  We once had a similar kind of bug
in the Mercury standard library implementation, where string__to_int was
not handling the most negative integer correctly.  We fixed that one in
March 1998.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.