id summary reporter owner description type status milestone component version severity resolution keywords cc 35 Self division wrong in template rational nobody Jonathan Turkanis "{{{ The definition of operator /= for class template rational does not handle self divisions (as in r /= r;) correctly: num = (num/gcd1) * (r.den/gcd2); den = (den/gcd2) * (r.num/gcd1); This code should be changed to: IntType rnum = r.num; num = (num/gcd1) * (r.den/gcd2); den = (den/gcd2) * (rnum/gcd1); Another solution would be to add: if(this == &r) { num = den = IntType(1); return *this; } }}}" Bugs closed None None Fixed