Version française
Home     About     Download     Resources     Contact us    
Browse thread
Pervasives.compare output type
[ 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] Pervasives.compare output type
Richard Jones <rich@annexia.org> writes:

>> type comparison_result = Less | Equals | Greater
>> 
>> What are the reasons behind the present design choice?
>
> Wouldn't it be for speed?  You could define Pervasives.compare over
> integers just as a subtraction.

You can't, because of overflow.

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