Am 01.12.2026 um 19:47 schrieb Kaz Kylheku:
> complex<double> is too much of a mouthful for a complex type > you will be reaching for a lot. > How it should have been designed is that there should have > been a basic_complex<T> template and complex being a typedef > name for basic_complex<double>
But apart from that, you don’t have any other problems, right ?
> If the C++ people designed it from scratch, it would be some > std::math::sin<double>(angle) type fuckery.
The standard library does not use namespaces quite so excessively, and there is the `using` keyword.
>> int main() >> { >> constexpr double Pi4 = 3.1415926535897932384626433832795 / 4.0;
> This is just stupid; a double only holds around 17 decimal > digits of precision (15 that are guaranteed to be preserved).
If you sum up the digits backwards, which is the most precise way, this could make a difference.
> Moreover, surely C++ has a pi constant somewhere? > > Evidently C++20 has ths: > > #include <iostream> > #include <numbers> > > // ... > std::numbers::pi; > std::numbers::pi_v<float>; > std::numbers::pi_v<long double>; > > It didn't occur to them until the pandemic hit that numeric programmers might > want the language to provide pi. > > They hit on the idea of avoiding pi_v<double>, like what I'm talking > about with the complex<T> verbosity above.
You constantly see problems where there aren't any.