Re: (atan 0 x) with gauche 0.9.14
Shiro Kawai <[email protected]> Wed, 17 Apr 2024 21:47:49 -1000
| Newsgroups | gmane.lisp.scheme.gauche |
|---|---|
| Message-ID | <CALN0JNHFTcq-AfU7V5zOYrGL88iNkTW9yd4GSKtBV0o7ZcDYgg@mail.gmail.com> |
R7RS has a pretty comprehensive table of all corner cases, but (atan 0 0) is said to be undefined (when both arguments are exact zeros). I decided to return NaN to prevent people from accidentally relying on any specific value. On Wed, Apr 17, 2024 at 9:23 PM Jens Thiele <[email protected]> wrote: > Shiro Kawai <[email protected]> writes: > > > Fix pushed. Also realized that (atan 0.0 0) and (atan -0.0 0) need a > > special treatment (the second arg is exact). > > Thanks! > > Total: 39739 tests, 39739 passed, 0 failed, 0 aborted. > > gosh$ (gauche-version) > "0.9.14-p1" > gosh$ (radians->degrees (atan 0 -1)) > 180.0 > > Greetings > Jens > > PS: at the moment I don't really want to follow into the (atan ±0 ±0) > rabbit hole but: > > gosh$ (atan 0 0) > +nan.0 > > scheme@(guile-user)> (atan 0 0) > $16 = 0.0 > > emacs > (atan 0 0) > 0.0 > > sbcl > * (atan 0 0) > 0.0 > > chicken > #;1> (atan 0 0) > 0.0 > > C > atan2(0,0) > 0.0 > > maxima: > (%i1) atan2(0,0); > > atan2: atan2(0,0) is undefined. > > > _______________________________________________ > Gauche-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/gauche-devel > _______________________________________________ Gauche-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gauche-devel