Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2006-10-31 12:09:50


On 10/29/06 3:23 PM, "Jason Hise" <0xchaos_at_[hidden]> wrote:

> On 10/29/06, Daryle Walker <darylew_at_[hidden]> wrote:
>> Couldn't there be better approximate fractions to use?
>>
>
> I'm not sure if there were other questions implied by the ommited
> portions of your post, but my best guess is that you are looking for
> an algorithm which builds a good fit rational number from a float
> without resorting to a simple and inefficient decimal truncation. If
> this is what you are looking for then what might work is a function
> which builds a rational number as a continued fraction.
[TRUNCATE description of the building algorithm]

Actually, the question was rhetorical. I already found, using various web
calculators, better approximate fractions that could be used instead of the
"crude" 301/1000 or 30103/100000. I was suggesting that we could use one of
those "better" fractions instead.

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com

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