caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dmitry Bely <dmitry.bely@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] testers wanted for experimental SSE2 back-end
Date: Tue, 23 Mar 2010 12:22:37 +0300	[thread overview]
Message-ID: <90823c941003230222i26ab423fm9f1325b28f5d4d45@mail.gmail.com> (raw)
In-Reply-To: <91a3da521003230207n3aebcdf2ia1faea03c9d13f6@mail.gmail.com>

On Tue, Mar 23, 2010 at 12:07 PM, Daniel Bünzli
<daniel.buenzli@erratique.ch> wrote:
>> let round x = truncate (x +. 0.5)
>
> Side note, if you are also interested in negative numbers

Sure, it was just an code generation example. Probably I should use
round_positive name.

> that's not what you want. You want :
>
>> let round x = floor (x +. 0.5)

...and you get a floor() C call. I would better use

let round x = truncate (x +. (if x > 0. then 0.5 else -0.5))

- Dmitry Bely


  reply	other threads:[~2010-03-23  9:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09 16:33 Xavier Leroy
2010-03-10 19:25 ` [Caml-list] " Mike Lin
2010-03-10 20:51   ` Will M. Farr
2010-03-11  8:42   ` Xavier Leroy
2010-03-13 16:10 ` Gaëtan DUBREIL
2010-03-23  8:58 ` Dmitry Bely
2010-03-23  9:07   ` Daniel Bünzli
2010-03-23  9:22     ` Dmitry Bely [this message]
2010-03-29 16:49   ` Xavier Leroy
2010-03-29 18:58     ` Dmitry Bely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90823c941003230222i26ab423fm9f1325b28f5d4d45@mail.gmail.com \
    --to=dmitry.bely@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).