caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: peio <peio.borthelle@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] truncated division, remainder and arithmetics
Date: Thu, 28 Jan 2016 20:03:24 +0100	[thread overview]
Message-ID: <1454007804.4675.38.camel@gmail.com> (raw)
In-Reply-To: <56A8995A.3030304@inria.fr>

> All contemporary microprocessors that implement division in hardware
> implement what you call truncated division.  The other forms of
> division and modulus (there are at least two others) can be
> implemented on top of that.  See this excellent summary:
> 
> Daan Leijen, Division and Modulus for Computer Scientists , July
> 2003.
> http://research.microsoft.com/apps/pubs/default.aspx?id=151917

Indeed I missed the fact of the processor available instructions.
Thanks for the clarification and for the reference. Interestingly
Leijen writes about optimisations possible with the euclidean division
which could maybe lead to easier hardware implementation, but this
surely is such a small simplification that instruction sets are
sticking to the truncated one due to inertia of backward-
compatibility..

> If you are doing computation with big numbers perhaps you can take a
> look at zarith, which define 
> many of the different division convention

I didn't knew about zarith and it seems interesting even if this is an
overkill for me.


cheers,
peio

      reply	other threads:[~2016-01-28 19:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27  0:34 peio
2016-01-27  9:56 ` François Bobot
2016-01-27 10:02 ` Hendrik Boom
2016-01-27 10:18 ` Xavier Leroy
2016-01-28 19:03   ` peio [this message]

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=1454007804.4675.38.camel@gmail.com \
    --to=peio.borthelle@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).