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
[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: 2003-10-30 (17:37)
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.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: