Version française
Home     About     Download     Resources     Contact us    
Browse thread
int_of_string bug
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: ls-ocaml-developer-2006@m...
Subject: Re: [Caml-list] int_of_string bug


Toby Kelsey <toby.kelsey@gmail.com> writes:

> Markus Mottl wrote:
>
>> The problem is just shifted to bigger numbers.  This problem arises
>> with all integer conversion functions, i.e. Int64.of_string,
>> Int32.of_string, Nativeint.of_string, int_of_string.
>> Regards
>> Markus
>
> This bug is not just a conversion problem:
>
> # let x = 1073741824;;
> val x : int = -1073741824
> # (x < 0) && (x >= -x);;
> - : bool = true


# let x = - 1073741824;;
val x : int = -1073741824
# -x;;
- : int = -1073741824

But this is as specified for modular ints. No surprise here ...


Regards -- Markus