Post Reply 
WP 34S Modulo Bug
06-22-2014, 02:43 PM
Post: #27
RE: WP 34S Modulo Bug
(06-22-2014 02:26 PM)Thomas Klemm Wrote:  Whatever the definition of MOD is, it should be idempotent:

Example in C:
Code:
#include <stdio.h>
int main()
{
    printf("%2d = %2d\n",  4 %  5, (  4 %  5) %  5);
    printf("%2d = %2d\n", -4 %  5, ( -4 %  5) %  5);
    printf("%2d = %2d\n",  4 % -5, (  4 % -5) % -5);
    printf("%2d = %2d\n", -4 % -5, ( -4 % -5) % -5);
}

Result:
Code:
 4 =  4
-4 = -4
 4 =  4
-4 = -4

This is clearly violated with the current implementation of MOD in the WP-34S:
-4 MOD 2 = 2
but
(-4 MOD 2) MOD 2 = 0

Cheers
Thomas

Yes, idempotency is required.

You seem to be willing to accept that remainder producing zero does not imply mod giving the same result?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
WP 34S Modulo Bug - Gerald H - 06-22-2014, 07:02 AM
RE: WP 34S Modulo Bug - walter b - 06-22-2014, 08:10 AM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 08:43 AM
RE: WP 34S Modulo Bug - pito - 06-22-2014, 10:44 AM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 10:48 AM
RE: WP 34S Modulo Bug - pito - 06-22-2014, 10:53 AM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 10:55 AM
RE: WP 34S Modulo Bug - HP67 - 06-22-2014, 09:04 AM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 10:54 AM
RE: WP 34S Modulo Bug - HP67 - 06-22-2014, 11:18 AM
RE: WP 34S Modulo Bug - jebem - 06-22-2014, 12:33 PM
RE: WP 34S Modulo Bug - HP67 - 06-22-2014, 12:35 PM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 12:36 PM
RE: WP 34S Modulo Bug - Paul Dale - 06-22-2014, 10:56 AM
RE: WP 34S Modulo Bug - Massimo Gnerucci - 06-22-2014, 11:32 AM
RE: WP 34S Modulo Bug - pito - 06-22-2014, 11:33 AM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 12:30 PM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 12:25 PM
RE: WP 34S Modulo Bug - Gerald H - 06-23-2014, 08:58 AM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 12:34 PM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 12:38 PM
RE: WP 34S Modulo Bug - Dieter - 06-22-2014, 01:11 PM
RE: WP 34S Modulo Bug - pito - 06-22-2014, 01:26 PM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 01:49 PM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 01:51 PM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014, 02:45 PM
RE: WP 34S Modulo Bug - Thomas Klemm - 06-22-2014, 02:05 PM
RE: WP 34S Modulo Bug - Thomas Klemm - 06-22-2014, 02:26 PM
RE: WP 34S Modulo Bug - Gerald H - 06-22-2014 02:43 PM
RE: WP 34S Modulo Bug - pito - 06-22-2014, 02:46 PM
RE: WP 34S Modulo Bug - walter b - 06-22-2014, 07:29 PM
RE: WP 34S Modulo Bug - walter b - 06-22-2014, 07:39 PM
RE: WP 34S Modulo Bug - Gerald H - 06-23-2014, 05:42 AM
RE: WP 34S Modulo Bug - walter b - 06-23-2014, 07:31 AM
RE: WP 34S Modulo Bug - Gerald H - 06-23-2014, 08:34 AM
RE: WP 34S Modulo Bug - Paul Dale - 06-23-2014, 08:40 AM
RE: WP 34S Modulo Bug - Andreas - 06-23-2014, 06:13 PM
RE: WP 34S Modulo Bug - Joe Horn - 06-22-2014, 08:41 PM
RE: WP 34S Modulo Bug - Paul Dale - 06-23-2014, 09:19 AM
RE: WP 34S Modulo Bug - Gerald H - 06-23-2014, 09:25 AM
RE: WP 34S Modulo Bug - walter b - 06-23-2014, 10:23 AM
RE: WP 34S Modulo Bug - Marcus von Cube - 06-23-2014, 06:50 PM
RE: WP 34S Modulo Bug - pito - 06-23-2014, 07:27 PM
RE: WP 34S Modulo Bug - Gerald H - 06-23-2014, 01:45 PM
RE: WP 34S Modulo Bug - jebem - 06-23-2014, 05:40 PM
RE: WP 34S Modulo Bug - Paul Dale - 06-23-2014, 09:48 PM
RE: WP 34S Modulo Bug - pito - 06-23-2014, 10:09 PM



User(s) browsing this thread: 5 Guest(s)