caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Mr. Herr" <misterherr@freenet.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] behaviour of mod
Date: Sun, 18 Jan 2015 22:06:33 +0100	[thread overview]
Message-ID: <54BC2059.7070603@freenet.de> (raw)
In-Reply-To: <54BBFFF7.6030106@mehnert.org>


On 18.01.2015 19:48, Hannes Mehnert wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA384
>
> Hi,
>
> is the behaviour of modulo arithmetics intentional:
>   -5 mod 4 = -1 ?
>
> While this reflects the C behaviour, my expectation was to always have
> a positive result:
>   -5 mod 4 = 3
>
> Any hints?
As I understand it, there is not one true solution, see 
http://en.wikipedia.org/wiki/Modulo_operation ,
and the different programming languages handle it very differently.

/Str

  parent reply	other threads:[~2015-01-18 21:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-18 18:48 Hannes Mehnert
2015-01-18 19:28 ` Gabriel Scherer
2015-01-18 21:06 ` Mr. Herr [this message]
2015-01-19 10:59 ` Stephen Dolan
2015-01-20 21:57   ` Yaron Minsky
2015-01-20 21:57     ` Yaron Minsky

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=54BC2059.7070603@freenet.de \
    --to=misterherr@freenet.de \
    --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).