Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atan2 fails to set floating-point exception in certain cases #310

Open
JayReynoldsFreeman opened this issue Sep 30, 2022 · 1 comment
Open

Comments

@JayReynoldsFreeman
Copy link

I am reporting is instances in which function "atan2", provided as part of the download of the 64-bit version of bullseye, fails to set the floating-point inexact exception when it should. These instances occur repeatably when compiling and running on a Raspberry Pi 4.

I am new to dealing with Raspberry Pi bugs: I submitted this here (RPi-Distro/repo) because it has to do with a package distributed by the Raspberry Pi folks and because I couldn't find any other likely place in GitHub to put it. Perhaps it should go to whoever maintains g++.

NOTE: The attached file is a c++ source file renamed as .TXT so that I could upload it. It has many comments and will demonstrate the bug.

AtanBug.c++.TXT

@popcornmix
Copy link

I just tested this on Ubuntu 22.04.1 LTS (x86_64)

dom@dom-XPS-13-9370:/tmp$ uname -a
Linux dom-XPS-13-9370 5.15.0-47-generic #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
dom@dom-XPS-13-9370:/tmp$ g++ --version
g++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dom@dom-XPS-13-9370:/tmp$ /usr/bin/g++ AtanBug.c++ -o AtanBug
dom@dom-XPS-13-9370:/tmp$ ./AtanBug 
atan2( 1.0, 0.0 ) is 1.570796326794896557998981734, and fetestexcept( FE_INEXACT ) returned 0
atan2( 0.0, -1.0 ) is 3.141592653589793115997963469, and fetestexcept( FE_INEXACT ) returned 0

which I believe you are claiming is the wrong result.

If the bug is not Pi specific, it needs to be reported with g++ maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants