/**
 * Finds the floating-point number in the given list that is closest to the target number.
 *
 * @param target The target number.
 * @param numbers A list of floating-point numbers.
 * @return The number in the list that is closest to the target.
 */
fun findClosestNumber(target: Double, numbers: List<Double>): Double {

    var closestNumber = numbers[0]
    var smallestDifference = Math.abs(closestNumber - target)

    for (number in numbers.drop(1)) {
        val difference = Math.abs(number - target)
        if (difference < smallestDifference) {
            closestNumber = number
            smallestDifference = difference
        }
    }

    return closestNumber
}
/**
 * Finds the floating-point number in the given list that is closest to the target number.
 *
 * @param target The target number.
 * @param numbers A list of floating-point numbers.
 * @return The number in the list that is closest to the target.
 */
fun findClosestNumber(target: Double, numbers: List<Double>): Double {
/**
 * Finds the floating-point number in the given list that is closest to the target number.
 *
 * @param target The target number.
 * @param numbers A list of floating-point numbers.
 * @return The number in the list that is closest to the target.
 */
fun findClosestNumber(target: Double, numbers: List<Double>): Double {

    var closestNumber = numbers[0]
    var smallestDifference = Math.abs(closestNumber - target)

    for (number in numbers.drop(1)) {
        val difference = Math.abs(number - target)
        if (difference < smallestDifference) {
            closestNumber = number
            smallestDifference = difference
        }
    }

    return closestNumber
}