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


Groups > comp.lang.forth > #27720

Hayes tester fails

From "Ed" <invalid@invalid.com>
Newsgroups comp.lang.forth
Subject Hayes tester fails
Date 2014-01-08 02:20 +1100
Organization Aioe.org NNTP Server
Message-ID <lah624$s2s$2@speranza.aioe.org> (permalink)

Show all headers | View raw


-24. 33 FM/MOD . . -1 9  ok

Now try this buggy definition found in a Forth implementation:

: FM/MOD ( d1 n1 -- n2 n3 )
  DUP >R
  SM/REM
  OVER 0<> OVER 0< AND IF
    SWAP R> + SWAP
    1-
  ELSE R> DROP THEN ;

-24. 33 FM/MOD . . 0 -24  ok

Notice the negative modulus.  That should never happen in floored
division when the divisor is positive.

Put the buggy routine through the Hayes tester and watch it pass.




Back to comp.lang.forth | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-08 02:20 +1100
  Re: Hayes tester fails "Alex McDonald" <blog@rivadpm.com> - 2014-01-07 21:15 +0000
  Re: Hayes tester fails "Alex McDonald" <blog@rivadpm.com> - 2014-01-07 21:20 +0000
  Re: Hayes tester fails anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-01-08 14:58 +0000
    Re: Hayes tester fails "Rod Pemberton" <dont_use_email@xnohavenotit.cnm> - 2014-01-08 19:53 -0500
    Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-09 21:49 +1100
      Re: Hayes tester fails anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-01-09 12:57 +0000
        Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-11 16:06 +1100
          Re: Hayes tester fails "Rod Pemberton" <dont_use_email@xnohavenotit.cnm> - 2014-01-11 10:28 -0500
          Re: Hayes tester fails anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-01-13 16:18 +0000
            Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-15 10:29 +1100
              Re: Hayes tester fails "Alex McDonald" <blog@rivadpm.com> - 2014-01-15 00:00 +0000
                Re: Hayes tester fails AKK <akk@nospam.org> - 2014-01-15 02:06 +0100
                Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-19 01:33 +1100
                Re: Hayes tester fails anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-01-18 16:58 +0000
                Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-21 00:09 +1100
                Re: Hayes tester fails "Alex McDonald" <blog@rivadpm.com> - 2014-01-20 14:36 +0000
                Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-25 22:53 +1100
                Re: Hayes tester fails "Alex McDonald" <blog@rivadpm.com> - 2014-01-25 23:21 +0000
                Re: Hayes tester fails anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-01-21 14:50 +0000
              Re: Hayes tester fails "Rod Pemberton" <dont_use_email@xnohavenotit.cnm> - 2014-01-15 02:40 -0500
                Re: Hayes tester fails "Elizabeth D. Rather" <erather@forth.com> - 2014-01-14 21:52 -1000
                Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-19 00:10 +1100
              Re: Hayes tester fails Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-01-15 03:28 -0600
      Re: Hayes tester fails "Rod Pemberton" <dont_use_email@xnohavenotit.cnm> - 2014-01-11 10:30 -0500
        Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-13 10:45 +1100
  Re: Hayes tester fails Howerd <howerdo@yahoo.co.uk> - 2014-01-09 02:51 -0800
    Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-09 22:12 +1100
      Re: Hayes tester fails Howerd <howerdo@yahoo.co.uk> - 2014-01-09 06:44 -0800
        Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-11 16:14 +1100
          Re: Hayes tester fails Howerd <howerdo@yahoo.co.uk> - 2014-01-11 02:35 -0800
          Re: Hayes tester fails Coos Haak <chforth@hccnet.nl> - 2014-01-11 13:46 +0100
            Re: Hayes tester fails "Ed" <invalid@invalid.com> - 2014-01-13 11:16 +1100

csiph-web