/**
 * This function checks for floating-point error while taking into account the epsilon value.
 * It returns true if the difference between two floating-point numbers is less than or equal to epsilon,
 * or if either of the numbers is zero, otherwise it returns false.
 *
 * @param a First floating-point number
 * @param b Second floating-point number
 * @return true if the difference between the numbers is within epsilon range or either number is zero,
 * false if the difference between the numbers is greater than epsilon and both numbers are non-zero
 */
fun checkFloatingPointErrorAndEpsilon(a: Double, b: Double): Boolean {

    val epsilon = 1e-10

    return (Math.abs(a - b) <= epsilon || a == 0.0 || b == 0.0)
}
/**
 * This function checks for floating-point error while taking into account the epsilon value.
 * It returns true if the difference between two floating-point numbers is less than or equal to epsilon,
 * or if either of the numbers is zero, otherwise it returns false.
 *
 * @param a First floating-point number
 * @param b Second floating-point number
 * @return true if the difference between the numbers is within epsilon range or either number is zero,
 * false if the difference between the numbers is greater than epsilon and both numbers are non-zero
 */
fun checkFloatingPointErrorAndEpsilon(a: Double, b: Double): Boolean {
/**
 * This function checks for floating-point error while taking into account the epsilon value.
 * It returns true if the difference between two floating-point numbers is less than or equal to epsilon,
 * or if either of the numbers is zero, otherwise it returns false.
 *
 * @param a First floating-point number
 * @param b Second floating-point number
 * @return true if the difference between the numbers is within epsilon range or either number is zero,
 * false if the difference between the numbers is greater than epsilon and both numbers are non-zero
 */
fun checkFloatingPointErrorAndEpsilon(a: Double, b: Double): Boolean {

    val epsilon = 1e-10

    return (Math.abs(a - b) <= epsilon || a == 0.0 || b == 0.0)
}