Public bug reported:
Binary package hint: libc6-amd64
When one sets the floating point environment to trap exceptions and uses
tanf with a value that should not produce singularities, an exception is
sometimes signalled.
To reproduce: store the following piece of code in a file foo.c and
build using gcc -o foo foo.c -lm When you execute the program, it will
give rise to an exception
What should have happened: The program should have output the value 1
#define _GNU_SOURCE
#include <math.h>
#include <fenv.h>
#include <stdio.h>
int main()
{
int bits = FE_UNDERFLOW;
feenableexcept(bits);
printf("%d", tanf((float)(M_PI/4)));
return 0;
}
** Affects: glibc (Ubuntu)
Importance: Undecided
Status: Unconfirmed
--
tanf causes FPE
https://launchpad.net/bugs/65998
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs