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: Marcin 'Qrczak' Kowalczyk <qrczak@k...>
Subject: Re: [Caml-list] Int overflow in literals
W li¶cie z pi±, 31-10-2003, godz. 17:42, Xavier Leroy pisze:

> 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).

Great!

> Does anyone know of a use scenario where this new behavior of
> int_of_string would be a problem?

I know one, assuming literals in source would be parsed by
int_of_string: writing the -0x40000000 literal.

Some languages explicitly say that it's permissible to write their
maxint+1 value as a literal only as a direct application of negation.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/

-------------------
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