m3m0ry / fixedpoint

Decimal fixed point type
Boost Software License 1.0
6 stars 3 forks source link

bugfix: use long for scaling #10

Closed Panke closed 2 years ago

m3m0ry commented 2 years ago

Wouldn't it make more sense to set the type of factor with the type of scaling? So if the scaling is in long, factor would use the long type. If scaling is an integer, factor would be int.

Panke commented 2 years ago

We could change the type of scaling to long, that should work as well, but in the end I don't think it matters. A scaling larger than 2^32 doesn't make much sense and keeping the type of scaling lower has no impact, since it is an constant anyway.

Note that currently the type of scaling is never long because it is explicitly typed as int.