Version française
Home     About     Download     Resources     Contact us    
Browse thread
2147483648l < 2147483647l
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Goswin von Brederlow <goswin-v-b@w...>
Subject: Re: [Caml-list] 2147483648l < 2147483647l
"David Allsopp" <dra-news@metastack.com> writes:

> Matej Kosik wrote:
>> I am sorry, I have a stupid question.
>> I would like to ask if this:
>> 
>> 	# 2147483648l < 2147483647l;;
>> 	- : bool = true
>
> The bug is in fact:
>
> # 2147483648l;;
> - : int32 = -2147483648l
>
> and given that behaviour, the above result makes sense! But...

Isn't that documented properly? I think in the docs I saw at least
that ocaml will silently overflow ints.

But yeah, the parser/compiler should really warn when that happens.

MfG
        Goswin