CMP EMBEDDED.COM

Login | Register     Welcome Guest  
HOME DESIGN PRODUCTS COLUMNS E-LEARNING CONFERENCES CODE FORUMS/BLOGS NEWSLETTERS CONTACT FEATURES RSS RSS

Listing 2: The bisection methods Listing 2: The bisection methods

// bisect the interval between elements k-1 and k
double bisect_left(int k){
assert((k > 0) && (npoints >= 2));
return (x[k] + x[k-1])/2;
}
// bisect the interval between elements k and k+1
double bisect_right(int k){
assert((k < npoints-1) && (npoints >= 2));
return (x[k] + x[k+1])/2;
}
Embedded.com Career Center
Looking for a new job?
SEARCH JOBS

Browse all jobs

SPONSOR
RECENT JOB POSTINGS





 :