maths: use mult rather than negation in constexpr
util::digits was triggering signed overflow warnings under gcc. By using negative multiplication rather than explicit negation we get the same behaviour, sans warning.
This commit is contained in:
parent
98c09df7f9
commit
3d5aff0f30
@ -312,7 +312,7 @@ namespace util {
|
|||||||
digits (ValueT value, BaseT base) noexcept
|
digits (ValueT value, BaseT base) noexcept
|
||||||
{
|
{
|
||||||
if (value < 0)
|
if (value < 0)
|
||||||
return digits (-value, base);
|
value *= -1;
|
||||||
|
|
||||||
unsigned tally = 1;
|
unsigned tally = 1;
|
||||||
while (value /= base)
|
while (value /= base)
|
||||||
|
Loading…
Reference in New Issue
Block a user