http://llvm.org/bugs/show_bug.cgi?id=16728
Bug ID: 16728
Summary: Semantics of negative zero in fmin and fmax
Product: clang
Version: 3.3
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Clang's implementation of fmin/fmax (and possibly other functions) treats
negative zero incompatibly with gcc, and inconsistent with regard to the order
of the arguments. Test case:
#include <math.h>
#include <stdio.h>
int main ()
{
printf("%f %f %f %f\n", fmin(-0.0, 0.0), fmin(0.0, -0.0), fmax(-0.0, 0.0),
fmax(0.0, -0.0));
}
In gcc, the result is, as one might expect:
-0.000000 -0.000000 0.000000 0.000000
But in clang, it is:
0.000000 -0.000000 0.000000 -0.000000
Also note how fmin(-0.0, 0.0) is different from fmin(0.0, -0.0), same goes for
fmax.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs