mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Added explicit check for remainder in divide_round_to_infinity
This commit is contained in:
parent
8c49e67702
commit
5312f5eddd
@ -274,12 +274,12 @@ namespace etl
|
||||
if (private_rounded_integral_division::are_same_sign(numerator, denominator))
|
||||
{
|
||||
// Same sign, round towards +infinity
|
||||
return remainder ? quotient + 1 : quotient;
|
||||
return (remainder != 0) ? quotient + 1 : quotient;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Different signs, round towards -infinity
|
||||
return remainder ? quotient - 1 : quotient;
|
||||
return (remainder != 0) ? quotient - 1 : quotient;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user