Browse thread
int_of_string bug
[
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: | 2007-03-30 (01:26) |
From: | Yaron Minsky <yminsky@c...> |
Subject: | Re: [Caml-list] int_of_string bug |
On 3/29/07, Brian Hurt <bhurt@spnz.org> wrote: > > > Wether this behavior (silent wrap around) is correct or not is another > argument. Elsewhere I have opinioned that the only purpose for having > more than one type of integer in your programming language is so that > programmers can pick the wrong one. But I'm widely known to be a heretic. > > Ocaml's behavior is, at least, *consistent*. Not really all that consistent: # int_of_string "1073741824";; - : int = -1073741824 # int_of_string "1073741825";; Exception: Failure "int_of_string". # y Brian > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >