Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
float precision on AMD64
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Ville-Pertti Keinonen <will@e...>
Subject: Re: [Caml-list] float precision on AMD64
Alan Falloon wrote:

> If we assume IEEE floating point format, then they can be compared as 
> integers. See the section "Comparing using integers" in


As the above link notes, since integers on most machines are 
twos-complement and not sign-magnitude, it doesn't work right for 
negative floats.

Working around this isn't possible without knowing it's actually a float 
(in which case a floating point compare could just be used, anyhow).