Skip to content

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_greater_nb function

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

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


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 equal to or less than the second value.


is_greater_nb function

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

Tell whether the first value is approximately greater than 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.