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-11-02 (16:25)
From: skaller <skaller@o...>
Subject: Re: [Caml-list] Int overflow in literals
On Sat, 2003-11-01 at 03:42, Xavier Leroy wrote:

> - The int_of_string functions raise an exception on overflow.
> Based on the comments posted so far on this list, and on a quick
> discussion with colleagues, I'm inclined toward the third approach
> (int_of_string fails in case of overflow).  Does anyone know of a use
> scenario where this new behavior of int_of_string would be a problem?

I cannot give a specific example, but I can paint a general
scenario: some data used with C is copied to ocaml (as text).

For example 0xFFFFFFFF is too large .. but in C it converts to -1
which is not too large :-)

Having given this example .. I have to say 'too bad', I think
your inclination is correct. [Whatever program extracted the
data from C should have handled this]

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