Fix FastRational
and test it s.t. it is reliable
#713
Labels
investigate
Suspicious or improper behaviour that needs to be investigates
priority:medium
Medium (normal) priority issue
Currently,
FastRational
uses signed integer for numerator and unsigned for denominator. This yields conversion issues and mixing such variables is not recommended in C++. I would be probably better to stick to just signed integers (e.g. as inboost::rational
) and detect whether they overflow after arithmetic operations.It can be also worth trying whether using
boost::rational
directly (if the values fit into 32 bits) would not be more reliable and also more efficient.Supporting the class with tests would be good.
#712 identifies a bug in constructor caused by incorrect casting.
The text was updated successfully, but these errors were encountered: