Skip to content

Fix random for custom scalars that don't have constexpr digits().

The NumTraits<Scalar>::digits() function isn't actually constexpr in some cases. In particular, our default implementation uses std::log2, which isn't constexpr. Unfortunately, this means we can't actually precompute the number of mantissa bits in general.

Merge request reports

Loading