Boost logo

Boost :

From: Andras Erdei (aerdei_at_[hidden])
Date: 2005-09-14 09:23:10


On 9/14/05, Joel Eidsath <jeidsath_at_[hidden]> wrote:
>
> What is important is what happens when you try to implement sqrt
> for boost::rational numbers. Or sin. Or log. Or a host of other
> functions. For example, what sort of answer would you get for sin(60
> degrees) * sqrt(3) / 3? (The exact answer is 1/2.)
>

(i am worried that this is just troll bait, but assuming it is a honest
question)

my guess would be "something closer to 1/2 than calculating
with floating point arithmetic using the same number of bits (or
maybe even the same number of CPU cycles)"

in case of boost::rational, i doubt it will ever have sin() -- or,
more precisely: the current boost::rational tries to do two things
at the same time. being a fixed precision type (where the name
is analogous to float, referring to the implementation), and that
may have sin(), and everything else; and being an unlimited
precision type (where the name refers to the mathematical
concept, and accidentally the current implementation method),
which is unlikely to ever have a sin() implemented

br,
andras


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