Thread overview
[Issue 17562] Tangent function returns NaN for abs(input) >= 2^63
Jun 27, 2017
Sophie
Jun 27, 2017
Sophie
Jun 27, 2017
Vladimir Panteleev
June 27, 2017
https://issues.dlang.org/show_bug.cgi?id=17562

Sophie <meapineapple@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|nobody@puremagic.com        |meapineapple@gmail.com

--
June 27, 2017
https://issues.dlang.org/show_bug.cgi?id=17562

Sophie <meapineapple@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|Mac OS X                    |All
           Severity|enhancement                 |minor

--
June 27, 2017
https://issues.dlang.org/show_bug.cgi?id=17562

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |dlang-bugzilla@thecybershad
                   |                            |ow.net

--
June 27, 2017
https://issues.dlang.org/show_bug.cgi?id=17562

--- Comment #1 from github-bugzilla@puremagic.com ---
Commit pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/0fb66f092b897b55318509c6582008b3f912311a Fix issue 17562 - tan returning -nan for inputs where abs(x) >= 2^63

The fptan instruction pushes a 1.0 onto the FPU register stack after a successful operation, but when abs(input) >= 2^63 the C2 flag is set to indicate that the input was out of bounds, and it doesn't push the 1.0.

Prior to this PR, the top value of the FPU stack was popped irrespective of whether C2 was set, which in the case of an out-of-bounds input caused the input to be removed from the stack and ultimately resulted in an incorrect return value of -nan. This PR changes this behavior, only popping after fptan when C2 was not set.

See: http://x86.renejeschke.de/html/file_module_x86_id_109.html

* Added unit tests for handling out-of-range inputs of fptan

--
August 16, 2017
https://issues.dlang.org/show_bug.cgi?id=17562

--- Comment #2 from github-bugzilla@puremagic.com ---
Commit pushed to stable at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/0fb66f092b897b55318509c6582008b3f912311a Fix issue 17562 - tan returning -nan for inputs where abs(x) >= 2^63

--
January 05, 2018
https://issues.dlang.org/show_bug.cgi?id=17562

--- Comment #3 from github-bugzilla@puremagic.com ---
Commit pushed to dmd-cxx at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/0fb66f092b897b55318509c6582008b3f912311a Fix issue 17562 - tan returning -nan for inputs where abs(x) >= 2^63

--