Embedded Template Library 1.0
Loading...
Searching...
No Matches
For

A set of rounding algorithms for scaled integrals.

Template Parameters
TThe integral type.
ScalingThe scaling factor.

emulating fixed point of two decimal places we could use a scaling factor of '100'. To round the result of scaled int calculations using 'Banker's Rounding' we would define this.

int final_result = round_half_even_unscaled<100>(accumulated_result);

For