https://llvm.org/bugs/show_bug.cgi?id=27193
Bug ID: 27193 Summary: std::acos on complex does not agree with C Product: libc++ Version: unspecified Hardware: Macintosh OS: MacOS X Status: NEW Severity: normal Priority: P Component: All Bugs Assignee: unassignedclangb...@nondot.org Reporter: j.o.e.lpub...@gmail.com CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com Classification: Unclassified Consider the following: $ clang --version Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin14.5.0 Thread model: posix $ cat x.cc #include <iostream> #include <complex> int main() { std::complex<double> x(0,3.14159265359); std::cout << std::acos(x) << std::endl; std::cout << std::cos(std::acos(x)) << std::endl; return 0; } $ clang++ -std=c++11 x.cc $ ./a.out (1.5708,-3.14159) (7.09802e-16,11.5487) $ cat z.c #include <math.h> #include <complex.h> #include <stdio.h> int main() { complex double z=0+3.14159*I; complex double r=cacos(z); complex double rr=ccos(r); printf("%e %e\n",creal(r),cimag(r)); printf("%e %e\n",creal(rr), cimag(rr)); return 0; } $ clang -std=c99 z.c $ ./a.out 1.570796e+00 -1.862295e+00 2.018773e-16 3.141590e+00 Compiling programs on linux with clang (and gnu standard libs) has C and C++ in agreement. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs