Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-02-21 11:37:34


Done.

----- Original Message -----
From: "Moore, Paul" <paul.moore_at_[hidden]>

> Can the following fix be applied to rational.hpp and rational_test.cpp?
>
> Thanks,
> Paul.
>
> --- boost_1_27_0\boost\rational.hpp.orig Thu Feb 21 16:09:11 2002
> +++ boost_1_27_0\boost\rational.hpp Thu Feb 21 16:09:27 2002
> @@ -298,6 +298,11 @@
> IntType gcd2 = gcd<IntType>(r_den, den);
> num = (num/gcd1) * (r_den/gcd2);
> den = (den/gcd2) * (r_num/gcd1);
> +
> + if (den < zero) {
> + num = -num;
> + den = -den;
> + }
> return *this;
> }
>
> --- boost_1_27_0\libs\rational\rational_test.cpp.orig Thu Feb 21 16:17:09
> 2002
> +++ boost_1_27_0\libs\rational\rational_test.cpp Thu Feb 21 16:17:17
> 2002
> @@ -280,6 +280,7 @@
> CHECK(( r0 == rat(16,15) ));
> r0 /= 4;
> CHECK(( r0 == rat(4,15) ));
> + CHECK(( rat(-1)/rat(-3) == rat(1,3) ));
>
> /* tests for operations on self */
> r0 = rat(4,3);
>
> Info: http://www.boost.org Send unsubscribe requests to:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk