Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
if (n:int) < 0 then (-n) > 0 is FALSE
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-12-08 (17:50)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] if (n:int) < 0 then (-n) > 0 is FALSE
On Thursday 07 December 2006 19:43, Mattias Engdegård wrote:
> Of course it is a bug

I wouldn't call it a bug. It looks like modulo arithmetic to me.

> I would love to have a fast unboxed integer type that automatically
> overflows to bignum, but it would be a tad slower than the current "int".

How can it be both unboxed and allow overflow to a bignum? Would you generate 
int and bigint versions of all functions and then bail to the bigint version 
if anything overflowed?

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists