Boost logo

Boost :

From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2005-01-28 17:38:15


Jason Hise wrote:
> Sérgio Vale e Pace wrote:
>
>>> Also, even when the difference of 1 is
>>> arrived at correctly, isn't it reasonable to assume that the lesser of
>>> the two numbers is the floor of the square root?
>>>
>>
>>
>> try 4
>>
> ahh... alright, I see the problem. So how about I just default X to N
> instead of 1?
>

You can start with X=(N-1)/2. This small adjustment came to my mind just
after I sent my previous post. It saves you one recursion step.


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