3 ms·
C/C++ don't define PI but have an atan function. According to the TIOBE Index for September 2020 (https://www.tiobe.com/tiobe-index/ https://www.tiobe.com/tiobe
by taylodl 6y ago
C/C++ don't define PI but have an atan function. According to the TIOBE Index for September 2020 (https://www.tiobe.com/tiobe-index/ https://www.tiobe.com/tiobe-index/) those languages are both in the top 5 of languages used by developers.
- votepaunchy 6y agoC++20 defines mathematical constants including Pi. https://en.cppreference.com/w/cpp/numeric/constants https://en.cppreference.com/w/cpp/numeric/constants
- taylodl 6y agoThanks for the heads up! I haven't been paying any attention to C++20. You must be on the cutting edge of C++ to know that - I ended up having to work a bit on my Macbook Pro to get a version of gcc working that defines std::numbers::pi.
- saagarjha 6y agoThey don’t but POSIX requires M_PI.