Message Boards Message Boards

Expound on function BinarySearch[list,key, Function]?

Posted 7 years ago

Please explain the requirements ( order of execution, compiled?, other constraints) on "Function" in BinarySearch[list, key, Func] I can define

Func[x_]:= x^2 

which works fine as a test example, but the function that I am trying to use without success is:

Func=(NIntegrate[ kernel[s],{s, x, (x+1)}]) / (NIntegrate[ kernel[s],{s, (x-1), x}]) 

which produces an error saying BS "variable is non-numeric" which suggests that Func was not evaluated before BS was evaluated. How do I get M to evaluate Func before evaluating BS?? Many thanks for your assistance.

POSTED BY: Gerald Kamin
2 Replies
POSTED BY: Daniel Lichtblau
POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract