Perhaps the lower_bound function will get you what you want?

Viggy

PS. Paul beat me to it!