Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2005-03-15 08:43:51

"Andy Little" <andy_at_[hidden]> wrote

 With this operator in place it is also possible
> to 'reduce' rationals to integers where possible and further to keep integral
> constants as integral types by default, knowing that conversion will be
> automatic if a fraction is required to prevent loss of precision.

To automatically 'reduce' a rational_c to an integral_c where its denominator is
1 was not sound. In practise the two types are not equivalent due to their
different behaviour in division. Obvious really. The obvious and safe scheme
involves using the mpl::operator::divides and always 'promoting' to a rational_c
in any mixed arithmetic.

Andy Little

Boost list run by bdawes at, gregod at, cpdaniel at, john at