Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

qamomile.optimization.utils

Overview

FunctionDescription
is_close_zeroCheck if a given floating-point value is close to zero within a small tolerance.

Functions

is_close_zero [source]

def is_close_zero(value: float, abs_tol = 1e-15) -> bool

Check if a given floating-point value is close to zero within a small tolerance.

Parameters:

NameTypeDescription
valuefloatThe floating-point value to check.

Returns:

bool — True if the value is close to zero, False otherwise.