using System.Collections.Generic;
public static void Main()
var l = new List<double>() {.0, .1, .2, .3, .4, .5, .6, .7 };
var index = l.FindIndexOfFirstValueLessThan(v);
Console.Write($"l[{index}] = ");
Console.WriteLine($"{l[index]}");
public static class ListExtensions
public static int FindIndexOfFirstValueLessThan<T>(this List<T> sortedList, T value, IComparer<T> comparer = null)
var index = sortedList.BinarySearch(value, comparer);