In which interval?

*To*: mathgroup at smc.vnet.net*Subject*: [mg13303] In which interval?*From*: "Pal Lillevold" <pal.lillevold at pensfins.no>*Date*: Fri, 17 Jul 1998 03:19:02 -0400*Organization*: AKT.PL LILLEVOLD*Sender*: owner-wri-mathgroup at wolfram.com

I need to resolve the following problem: Given N distinct real Intervals (x(i),x(i+1)); i=1,,,,N and a real number R - in which interval is R located. In other words to identify the unique value of i such that x(i)<=R<x(i+1). This is easy to do by straight forward checking which value of the N i's which match the inequalities. But this is very time-consuming when the number N is large. Has anyone been confronted with this problem and resolved it efficiently? I would highly appreciate any assistance. Thank you in advance and best regards. Pal Lillevold