../units/src/core/include/units/magnitude.h: In instantiation of 'static constexpr intmax_t units::detail::prime_factorization<N>::get_or_compute_first_factor() [with long long int N = 149597870700; intmax_t = long long int]':
../units/src/core/include/units/magnitude.h:627:74: required from 'constexpr const intmax_t units::detail::prime_factorization<149597870700>::first_base'
../units/src/core/include/units/magnitude.h:632:54: required from 'constexpr const auto units::detail::prime_factorization<149597870700>::value'
../units/src/core/include/units/magnitude.h:631:25: required from 'struct units::detail::prime_factorization<149597870700>'
../units/src/core/include/units/magnitude.h:642:71: required from 'constexpr const auto units::detail::prime_factorization_v<149597870700>'
../units/src/core/include/units/magnitude.h:655:18: required from 'constexpr auto [requires units::Magnitude<<placeholder>, >] units::mag() [with ratio R = ratio{149597870700, 1}]'
../units/src/systems/si/include/units/isq/si/length.h:59:91: required from here
../units/src/core/include/units/magnitude.h:623:70: error: unsigned conversion from 'long long int' to 'std::size_t' {aka 'unsigned int'} changes value from '149597870700' to '3568982636' [-Werror=overflow]
623 | return static_cast<std::intmax_t>(factorizer::find_first_factor(N));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
The major missing work here is to see how the latex math, inside dollar
signs, translates to the docs.
I also added a new constant, `pi`, to make the docs correct: this should
be much more user friendly.
This is not intended to be "complete". Rather, the goal is to deliver
the raw content so that experts can massage it.
This lets us remove a ton of special-casing throughout the codebase, and
just generally makes things a lot simpler.
We also remove the ability to take rational powers of `ratio`, including
`sqrt` and `cbrt` helpers, because these are intrinsically ill-defined.
Fixes#369.
The algorithm is exactly the same; we just get our values for
`num_value`, `den_value`, and `exp10` in different ways.
The old printing logic assumed the ratio/Magnitude was an exact rational
number. Formerly, we couldn't even _represent_ anything else, but with
Magnitude, we can. Thus, we guard this assumption with a
`static_assert`. Later on, we can figure out how we want to print
irrational bases and/or rational powers. The point of this change is to
unblock us from moving to the new infrastructure.