Page 1 of 1

Logarithmic Search [Solved]

Posted: Fri Feb 20, 2015 11:01 am
by atout66
Hi to all,

This post refers to the lesson from this page:
http://lessons.runrev.com/s/lessons/m/4 ... h-an-array
It refers to the section <function logarithmicSearch > provided in that page.
The problem: at line

Code: Select all

put round ((pLeft + pRight) / 2) into tIndex
the debugger stop with an error as:(Operator +: error in right operand), char 9
char 9 is <+>
Here is a piece of code for this function.

Code: Select all

function logarithmicSearch @pArray pItem pLeft pRight
    local tIndex
    local tResult
    # create a new range pointer that points to the item that lies
    # right between the left and right range pointers
    put round ((pLeft + pRight) / 2) into tIndex
pLeft = 0 and pRight = 35 in my example...

Any idea would be much appreciated.
Thanks

[Solved]Re: Logarithmic Search [Solved]

Posted: Fri Feb 20, 2015 11:33 am
by atout66
Oups, sorry to all, I realised that my <pRight> argument was a list ! not a unique number.

I the modo want to remove this post, no problem at all...

Sorry.