From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id B67FF7F6D8 for ; Sun, 18 Jan 2015 22:08:44 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of misterherr@freenet.de) identity=pra; client-ip=195.4.92.90; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="misterherr@freenet.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of misterherr@freenet.de) identity=mailfrom; client-ip=195.4.92.90; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="misterherr@freenet.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mout0.freenet.de) identity=helo; client-ip=195.4.92.90; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="postmaster@mout0.freenet.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArAAAEsgvFTDBFxanGdsb2JhbABbgmR0WYMFwzaFcQKBDkMBAQEBAREBAQEBAQYNCQkULoQNAQUjFUARCxgCAgUWCwICCQMCAQIBRRMIAQEXh3wBFQMBCLpIjjwJgS8BgzoBK4Ehjl8WglKBQQWOWYNHi3wDi3uCIx2BUYMxAQEB X-IPAS-Result: ArAAAEsgvFTDBFxanGdsb2JhbABbgmR0WYMFwzaFcQKBDkMBAQEBAREBAQEBAQYNCQkULoQNAQUjFUARCxgCAgUWCwICCQMCAQIBRRMIAQEXh3wBFQMBCLpIjjwJgS8BgzoBK4Ehjl8WglKBQQWOWYNHi3wDi3uCIx2BUYMxAQEB X-IronPort-AV: E=Sophos;i="5.09,422,1418079600"; d="scan'208";a="96822829" Received: from mout0.freenet.de ([195.4.92.90]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Jan 2015 22:08:43 +0100 Received: from [195.4.92.141] (helo=mjail1.freenet.de) by mout0.freenet.de with esmtpa (ID misterherr@freenet.de) (port 25) (Exim 4.82 #2) id 1YCx5O-0000Ic-GJ for caml-list@inria.fr; Sun, 18 Jan 2015 22:08:42 +0100 Received: from localhost ([::1]:37589 helo=mjail1.freenet.de) by mjail1.freenet.de with esmtpa (ID misterherr@freenet.de) (Exim 4.82 #2) id 1YCx5O-0000hh-AL for caml-list@inria.fr; Sun, 18 Jan 2015 22:08:42 +0100 Received: from mx5.freenet.de ([195.4.92.15]:47790) by mjail1.freenet.de with esmtpa (ID misterherr@freenet.de) (Exim 4.82 #2) id 1YCx3K-0007Ef-Qo for caml-list@inria.fr; Sun, 18 Jan 2015 22:06:34 +0100 Received: from [2001:1a80:303b:0:21d:e0ff:fe23:2b] (port=40868 helo=suse132-acer.home.loc) by mx5.freenet.de with esmtpsa (ID misterherr@freenet.de) (TLSv1.2:DHE-RSA-AES128-SHA:128) (port 465) (Exim 4.82 #2) id 1YCx3K-0008Gn-LZ for caml-list@inria.fr; Sun, 18 Jan 2015 22:06:34 +0100 Message-ID: <54BC2059.7070603@freenet.de> Date: Sun, 18 Jan 2015 22:06:33 +0100 From: "Mr. Herr" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: caml-list@inria.fr References: <54BBFFF7.6030106@mehnert.org> In-Reply-To: <54BBFFF7.6030106@mehnert.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Originated-At: 2001:1a80:303b:0:21d:e0ff:fe23:2b!40868 Subject: Re: [Caml-list] behaviour of mod 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