Method MulDivRound
- Namespace
- DocWright.Core.Primitives
- Assembly
- DocWright.Core.dll
MulDivRound(long, long, long)
Computes value * multiplier / divisor entirely in 64-bit integer arithmetic,
rounding the quotient half away from zero.
public static long MulDivRound(long value, long multiplier, long divisor)
Parameters
valuelongThe value to scale.
multiplierlongThe multiplier.
divisorlongThe divisor. Must not be zero.
Returns
- long
The scaled, rounded value.
Exceptions
- DivideByZeroException
divisoris zero.- OverflowException
An intermediate product overflows a long.