Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Int overflow in literals
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alex Baretta <alex@b...>
Subject: Re: [Caml-list] Int overflow in literals
Marcin 'Qrczak' Kowalczyk wrote:
> I understand that int overflow is not checked on arithmetic for
> efficiency reasons, but IMHO it would be better if it was checked
> at least in literals. When someone writes 10000000000, he certainly
> does not mean -737418240.
> 
> It caused confusion in a class when someone was interactively testing
> a function with larger and larger inputs.
> 

I bet the official answer is "It's can't be done because native integers 
are 31 bits on 32 bit platforms, 63 bits on 64 bit platforms, so what is 
parser supposed to do? Especially in the case of the bytecode compiler."
Although, I suppose something could be done in the toplevel.

Alex

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners