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


Groups > comp.lang.forth > #50378

fatan2 2012

From "HAA" <someone@microsoft.com>
Newsgroups comp.lang.forth
Subject fatan2 2012
Date 2016-08-22 13:44 +1000
Organization Aioe.org NNTP Server
Message-ID <npdse1$1s5g$1@gioia.aioe.org> (permalink)

Show all headers | View raw


From the PDF ...

12.6.2.1489 FATAN2 "f-a-tan-two" FLOATING EXT
( F: r1 r2 -- r3 ) or ( r1 r2 -- r3 )
r3 is the principal radian angle (between -pi and pi ) whose tangent is r1 / r2 .
A system that returns false for "-0E 0E 0E F~" shall return a value (approximating) -pi
when r1 = 0E and r2 is negative.

Gforth 0.7.0, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
-0e 0e 0e f~ . 0  ok
0e -1e fatan2 fs. 3.14159265358979E0  ok

Same for Win32Forth

What should I do now?

I assume there is an error in the test as supplied.

BTW there several 'corner case' tests that could be applied to FATAN2.
Singling out one with no explanation is only going to leave readers with
questions when it does fail i.e. what's so special about *this* test.
Then there is the reliance on the notorious F~ whose results can be
right or wrong depending upon your expectations e.g.

SwiftForth i386-Win32 3.6.2 04-Apr-2016

0e pad f! pad 1 floats dump
  4809E8 00 00 00 00 00 00 00 00                         ........         ok
0e fnegate pad f! pad 1 floats dump
  4809E8 00 00 00 00 00 00 00 80                         ........         ok

0e fdup fnegate 0e f~ . -1  ok

0e fs. 0.0000000E+00  ok
0e fnegate fs. 0.0000000E+00  ok



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


Thread

fatan2 2012 "HAA" <someone@microsoft.com> - 2016-08-22 13:44 +1000
  Re: fatan2 2012 Paul Rubin <no.email@nospam.invalid> - 2016-08-21 21:01 -0700
  Re: fatan2 2012 peter.m.falth@gmail.com - 2016-08-22 00:42 -0700
  Re: fatan2 2012 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-08-22 10:00 +0000
    Re: fatan2 2012 "HAA" <someone@microsoft.com> - 2016-08-23 12:51 +1000
      Re: fatan2 2012 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-08-23 11:11 +0000
        Re: fatan2 2012 "HAA" <someone@microsoft.com> - 2016-08-25 02:16 +1000
        Re: fatan2 2012 albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-02 18:03 +0200
          Re: fatan2 2012 Paul Rubin <no.email@nospam.invalid> - 2016-09-02 12:02 -0700

csiph-web