Ticket #5855: rational_fix.patch
File rational_fix.patch, 879 bytes (added by , 11 years ago) |
---|
-
boost/rational.hpp
389 389 390 390 // Determine relative order by expanding each value to its simple continued 391 391 // fraction representation using the Euclidian GCD algorithm. 392 struct { int_type n, d, q, r; } ts = { this->num, this->den, this->num / 393 this->den, this->num % this->den }, rs = { r.num, r.den, r.num / r.den, 394 r.num % r.den }; 392 struct { int_type n, d, q, r; } 393 ts = { this->num, this->den, 394 int_type(this->num / this->den), int_type(this->num % this->den) }, 395 rs = { r.num, r.den, 396 int_type(r.num / r.den), int_type(r.num % r.den) }; 395 397 unsigned reverse = 0u; 396 398 397 399 // Normalize negative moduli by repeatedly adding the (positive) denominator