Skip to content

isclose

relationalai.semantics.std.math
isclose(
x: NumberValue, y: NumberValue, tolerance: NumberValue = 1e-09
) -> Expression

Check if two values are approximately equal within an absolute tolerance.

Uses abs(x - y) <= abs(tolerance). Unlike Python’s isclose, there is no relative tolerance component.

  • Expression - An Expression that evaluates to true if abs(x - y) <= abs(tolerance).

Check if a value is close to a target:

>>> select(math.isclose(Product.price, 9.99, 0.01))
RelationalAI Documentation
└──  Release Notes
    └──  Python API Release Notes
        └──  What’s New in Version 1.0.6
            └──  Bug Fixes