Browse thread
[Caml-list] Int overflow in literals
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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 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