Skip to content
New: Star-import, signal unraveling, Python 3.12 support, and more

# math_ module

Math utilities.

## add_nb function

    add_nb(
        a,
        b,
        use_tol=True,
        rel_tol=1e-09,
        abs_tol=1e-12
    )

Add two floats.

## is_addition_zero_nb function

    is_addition_zero_nb(
        a,
        b,
        use_tol=True,
        rel_tol=1e-09,
        abs_tol=1e-12
    )

Tell whether addition of two values yields zero.

## is_close_nb function

    is_close_nb(
        a,
        b,
        use_tol=True,
        rel_tol=1e-09,
        abs_tol=1e-12
    )

Tell whether two values are approximately equal.

## is_close_or_less_nb function

    is_close_or_less_nb(
        a,
        b,
        use_tol=True,
        rel_tol=1e-09,
        abs_tol=1e-12
    )

Tell whether the first value is approximately less than or equal to the second value.

## is_less_nb function

    is_less_nb(
        a,
        b,
        use_tol=True,
        rel_tol=1e-09,
        abs_tol=1e-12
    )

Tell whether the first value is approximately less than the second value.

## round_nb function

    round_nb(
        a,
        use_round=True,
        decimals=12
    )

Round a float to a number of decimals.

#### Cookie consent

We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.

- Google Analytics
- GitHub

Manage settings