vpiotr / decimal_for_cpp

Decimal data type for C++
273 stars 68 forks source link

Decimal allows mixing two different rounding policies in one operation #68

Closed vpiotr closed 2 months ago

vpiotr commented 2 months ago

For single operation only one rounding policy should be possible, right now two are accepted with undefined behavior.

For example:

const decimal operator/(const decimal<Prec2>& rhs) const {

in this operator rhs can have a different rounding specified.

vpiotr commented 2 months ago

Corrected