Documentation

Function from library math

isclose(ab)

iscloseab

Returns True if two values are approximately equal: close to each other within a tolerance.

Two values are close if their absolute difference is not greater than the highest between the relative and absolute tolerances.

afirst value to compare

bsecond value to compare

True if the two values are close to each other, False otherwise
Code
isclose(3.01, 3)
Result
False
Code
isclose(0.1 + 0.2, 0.3)
Result
True

See also isclose in the official documentation

Logo of PyTamaro

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy PolicyPlatform Version 51a7c2e (Tue, 22 Apr 2025 08:35:06 GMT)