tanf causes FPE
Bug #65998 reported by
Juanjo Garcia-Ripoll
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
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;
feenableexcep
printf("%d", tanf((float)
return 0;
}
To post a comment you must log in.
confirmed with glibc-2.5, amd64; works on i386