Java tutorial
import java.util.Arrays; public class Main { public static void main(String[] args) { // initializing sorted float array float floatArr[] = { 5.2f, 5.3f, 5.9f, 6.3f }; // value to search float searchVal = 6.3f; int retVal = Arrays.binarySearch(floatArr, searchVal); System.out.println("The index of element 6.3 is : " + retVal); } }