modulo-Problem

Issue #283 invalid
Former user created an issue

Originally reported on Google Code with ID 283 ``` What steps will reproduce the problem? 1. Input: mod(-3;2) 2. Input: mod(-999;1001)

What is the expected output? What do you see instead? 1. should be: 1 is: -1 2. should be: 2 is: -999

What version of the product are you using? On what operating system? Version 4.4.0, Portable, in Microsoft Windows XP Professional Version 2002 Service Pack 3

Please provide any additional information below.

```

Reported by `auer_richard@yahoo.de` on 2009-04-30 10:45:57

Comments (1)

  1. Former user Account Deleted

    ``` mod is connected to idiv, and to ensure the equation a = b*q + r holds (q = idiv(a;b), r = mod(a;b)), mod has to take negative values in certain combinations. As you can see, all boils down to the question, whether idiv assumes the floor integer, or the truncated integer value of the quotient. When I implemented idiv, I thought, truncation would be more intuitive. I was aware of the "discontinuity" at 0, which a pure number theorist would have avoided, but those people know how to fix the result, and all others get what they expect. Unless there is an overwhelming vote from user side to change this, I would like to see the current semantics of idiv, und thus mod, stay. I'd rather see this issue marked as 'rejected' than as 'invalid', but there is no such option. ```

    Reported by `wolf.lammen` on 2009-05-01 09:13:12 - Status changed: `Invalid`

  2. Log in to comment