English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Need for a built in round_to_int function
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-21 (06:50)
From: Erik de Castro Lopo <ocaml-erikd@m...>
Subject: Re: [Caml-list] Need for a built in round_to_int function
On Sun, 20 Feb 2005 20:34:14 -0800
Robert Roessler <roessler@rftp.com> wrote:

> Actually, emulating the VC7 "/QIfist" does NOT cause "all int_to_float 
> to behave like a round instead of a truncate" - it does exactly what 
> we are already talking about: do the int_of_float with a "bare" 
> FIST[P], operating in whatever rounding mode the hardware is already 
> in (presumably one we want and expect it to be in).

Implementing your proposal, means that int_of_float will change
behaviour depending on a compiler flag. I think thats a bad

My proposal leaves int_of_float just as it is and defines a new

    val round_to_int : float -> int

which expand to a FISTPL instruction and one or two glue 

  Erik de Castro Lopo  nospam@mega-nerd.com (Yes it's valid)
Good advice for everyone : stay away from churches, mosques and