From: Cromwell Enage (sponage_at_[hidden])
Date: 2005-03-28 12:52:35
--- Andy Little wrote: ---
> Why not call this one mixed_number?
> IMO your fraction \ fraction_c functionality should
> be called rational \ rational_c for compatibility
> with the runtime boost::rational.
Okay. I suppose my choice of names was somewhat
pedantic, more appropriate in elementary school than
> FWIW IMO with your current 'rational, the extra
> parameters extend the range but not indefinitely and
> the extra number and especially sign parameters are
You prefer something like the following?
I guess the added readability would be worth the extra
logic required to calculate the sign.
> Surely better functionality and less namespace
> pollution could be had with a big_int parameter to
> the two param type.
You mean allowing Big Integral Constants as template
arguments? This would eliminate the need for
big_fraction/big_rational and big_mixed_number, but
not the concepts they were meant to model. Shouldn't
be too difficult to implement, but I need to cut down
the compile times of the other big_integral test
programs before testing rationals with such arguments
> However currently the docs state the integral
> constant requirement on parameters which IMO is an
> unnecessary restriction.
Once I attempt to allow template arguments beyond
Integral Constants and Big Integral Constants, I risk
duplicating the functionality already provided by
mpl::divides<>. Any good reason you'd want me to do
this? For example, what would a recursive rational
provide that dividing the fraction numerator by the
fraction denominator would not?
> For example a more generic alternative to
> abs_integral could be implemented as follows,
> which might be a useful mpl function anyway.
Come to think of it, mpl::abs<> would be a useful
I'll work through all of this when I get the chance.
I have lots of personal matters to attend to before
Cromwell D. Enage
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk