-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
| Bugzilla Link | 27193 |
| Version | unspecified |
| OS | MacOS X |
| Reporter | LLVM Bugzilla Contributor |
| CC | @hfinkel,@mclow,@zamazan4ik |
Extended Description
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.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.