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


Groups > comp.lang.forth > #42104

Re: Problem with GForth

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: Problem with GForth
Date 2015-09-21 20:14 +0200
Organization A noiseless patient Spider
Message-ID <mtphbd$tmi$2@dont-email.me> (permalink)
References <31b943ff-db41-4f89-9fb1-6f2fb823140c@googlegroups.com>

Show all headers | View raw


lehs wrote:

> When trying this in GForth for Windows:
> 
> : U2/ 1 RSHIFT ;
> 
> : U/ 0 UM/MOD NIP ;
> 
> : SQRT \ m -- n
>   DUP 4 U< IF DUP IF DROP 1 THEN EXIT THEN
>   DUP 1- >R U2/
>   BEGIN R@ OVER U/ OVER + U2/ TUCK U> 0=
>   UNTIL RDROP ;
> 
> 10 SQRT .
> 
> I got the error message:
> 
> :15: Floating-point unidentified fault
>>>>sqrt<<<
> Backtrace:
> 
> How come?

0 UM/MOD

is a division by zero.  You probably want

0 SWAP UM/MOD

Unfortunately, division by zero is signalled as floating point error, and on 
Windows, the attempt to idenitfy which floating point error fails.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*
http://bernd-paysan.de/

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


Thread

Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-09-21 11:09 -0700
  Re: Problem with GForth Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-21 20:14 +0200
    Re: Problem with GForth "Elizabeth D. Rather" <erather@forth.com> - 2015-09-21 12:36 -1000
      Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-09-21 16:20 -0700
        Re: Problem with GForth Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-22 02:37 +0200
          Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-09-21 22:59 -0700
          Re: Problem with GForth "Elizabeth D. Rather" <erather@forth.com> - 2015-09-21 20:04 -1000
    Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-09-21 16:17 -0700
      Re: Problem with GForth Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-22 02:35 +0200
    Re: Problem with GForth hughaguilar96@gmail.com - 2015-09-21 23:30 -0700
    Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-10-07 18:33 -0700
      Re: Problem with GForth Paul Rubin <no.email@nospam.invalid> - 2015-10-07 19:03 -0700
      Re: Problem with GForth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-08 07:45 +0000
        Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-10-08 05:06 -0700
          Re: Problem with GForth Howerd <howerdo@yahoo.co.uk> - 2015-10-08 14:24 -0700
            Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-10-08 22:49 -0700
              Re: Problem with GForth Paul Rubin <no.email@nospam.invalid> - 2015-10-08 23:11 -0700
          Re: Problem with GForth Coos Haak <chforth@hccnet.nl> - 2015-10-09 01:01 +0200
            Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-10-08 22:53 -0700
              Re: Problem with GForth Coos Haak <chforth@hccnet.nl> - 2015-10-09 10:04 +0200
                Re: Problem with GForth Paul Rubin <no.email@nospam.invalid> - 2015-10-09 01:23 -0700
                Re: Problem with GForth Coos Haak <chforth@hccnet.nl> - 2015-10-09 12:32 +0200
          Re: Problem with GForth "WJ" <w_a_x_man@yahoo.com> - 2015-10-08 23:34 +0000
            Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-10-08 22:55 -0700
          Re: Problem with GForth Paul Rubin <no.email@nospam.invalid> - 2015-10-08 16:52 -0700
            Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-10-08 23:03 -0700
            Re: Problem with GForth Coos Haak <chforth@hccnet.nl> - 2015-10-09 10:21 +0200
              Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-10-09 08:04 -0700
            Re: Problem with GForth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-10 11:03 +0000
              Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-10-13 12:34 -0700
            Re: Problem with GForth Marcos Cruz <use_the_contact_page@programandala.net> - 2015-10-13 18:31 +0000
              Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-10-13 12:40 -0700
                Re: Problem with GForth Marcos Cruz <use_the_contact_page@programandala.net> - 2015-10-14 20:20 +0000
          Re: Problem with GForth "WJ" <w_a_x_man@yahoo.com> - 2015-10-09 05:58 +0000
            Re: Problem with GForth lehs <skydda.barnen@gmail.com> - 2015-10-08 23:08 -0700
            Re: Problem with GForth mhx@iae.nl - 2015-10-09 00:30 -0700

csiph-web