Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

Before C++20, using common mathematical constants relied on either POSIX or a compiler extension through the <math.h> header. C++20 introduced a new <numbers> header that provides common mathematical constants as templates that can be specialized for user types. The standard library provides float, double and long double specialisations with an alias for the double variant. Compiler Explorer link: https://lnkd.in/emfjTATb #cpp #cplusplus #coding #programming #dailybiteofcpp

  • text

I've actually not long moved all recent projects to use pi_v in the numbers header, but my mind compiler cannot parse that inline constexpr line! 🤯

To view or add a comment, sign in

Explore content categories