I'm having a weird dynamic failure using Boost.Rational.
Using some rationals and doing a calculus, i'm ending with a rational with a negative denominator, and so unusable for comparison (hence the r.den > 0 assertion failure during the execution).
I've come to a trick : (with typedef boost::rational rat)
rat x = /* ... some calculus with variable of type rat ... */ ;
x = rat(x.numerator(), x.denominator());
Well, this is'nt pretty. What's more, it implicates some operations of numbers of type mpz_class : so it takes time, and my program is greedy about it (it's a Bentley-Ottmann's algorithm on thousands of segment lines).
Any idea to avoid something that greedy ?
Thankfully
@Micheal Olea : honest mistake ;) Thanks for the interest.
--
Pierre Cagne
pierre.cagne@gmail.com