http://llvm.org/bugs/show_bug.cgi?id=5044
Summary: sqrt(-1.0) = 0
Product: new-bugs
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P2
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Created an attachment (id=3555)
--> (http://llvm.org/bugs/attachment.cgi?id=3555)
svn diff output
When called indirectly the sqrt function returns 0 for an input of -1.0 rather
than NAN. compiling the following program with llvm-gcc -O3 demonstrates the
problem
-------------------------------------------
#include <stdio.h>
#include <math.h>
double mysqrt(double x) {
return sqrt(x);
}
int main() {
printf("sqrt(-1) == %G\n", mysqrt(-1.0));
}
--------------------------------------------
A fix for the bug is attached
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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