Trigonometric functions: Difference between revisions

Content added Content deleted
(→‎{{header|C++}}: oops ... std:: required before cmath functions (although most compilers will also compile it without))
Line 162: Line 162:
double const pi = M_PI;
double const pi = M_PI;
#else
#else
double const pi = 4*atan(1);
double const pi = 4*std::atan(1);
#endif
#endif


Line 184: Line 184:
std::cout << "arccos(1/2) = " << std::acos(0.5)/degree << "°\n";
std::cout << "arccos(1/2) = " << std::acos(0.5)/degree << "°\n";
std::cout << "arctan(1/2) = " << std::atan(0.5)/degree << "°\n";
std::cout << "arctan(1/2) = " << std::atan(0.5)/degree << "°\n";

return 0;
}
}
</lang>
</lang>