Finds the closest arithmetic match in an array, using Binary Search
You can install the package via composer:
composer require kyos/find-closest-value
echo (new Kyos\FindClosestValue\FindClosestValue())->findClosest([2, 5, 9], 4); // 5
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.