Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8437

Re: Mod and QuotientRemainder are inconsistent

From Andrzej Kozlowski <akoz@mimuw.edu.pl>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Mod and QuotientRemainder are inconsistent
Date 2012-02-10 10:52 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jh2stu$ju$1@smc.vnet.net> (permalink)
References <201202091035.FAA18248@smc.vnet.net>

Show all headers | View raw


Note also that:

Mod[12, 0.1, 1]

 1.

etc., which suggest to me that the result for Mod[12,0.1] must be a bug.

Andrzej Kozlowski




On 9 Feb 2012, at 11:35, Szabolcs wrote:

>
> Mod[12, 0.1] gives 0.1 despite 120*0.1 = 12.  I expect this is because 0.1 is not representable in binary.
>
> QuotientRemainder[12, 0.1] gives {120, 0.} however, which is inconsistent with the result above.
>
> Quotient[12,0.1] gives 120 which is also inconsistent with Mod.
>
> Is this a bug or is it by design?  It seems it is not safe to assume that
>
> QuotientRemainder[a,b] = {Quotient[a,b], Mod[a,b]}
>
> or that
>
> Quotient[a,b]*b + Mod[a,b] = a
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Mod and QuotientRemainder are inconsistent Andrzej Kozlowski <akoz@mimuw.edu.pl> - 2012-02-10 10:52 +0000

csiph-web