
11 Sep
2005
11 Sep
'05
12:40 p.m.
I didn't see a cost savings (or penalty) there.
I don't even know why I need to say this. For one thing, just look the GCD call at the creation of every boost::rational. You must understand the costs involved there when numbers get big.
It does something akin to the built-in floating-point types on common platforms (which are IEEE-754) with a binary mantissa and exponent. It's a tradeoff, giving up arbitrary denominators for quicker manipulation.
Explain how you'd implement the square root function for a boost::rational type class. (Or a host of other functions.) Lots of calls to set_precision, I expect. Joel Eidsath