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.

typedef etl::scaled_rounding<int, 100> Rounding;
int final_result = Rounding::round_half_even_unscaled(accumulated_result);

For