close

compas.geometry.close(value1, value2, tol=1e-05)[source]

Returns True if two values are equal within a tolerance.

Parameters
  • value1 (float or int)

  • value2 (float or int)

  • tol (float, optional) – The tolerance for comparing values. Default is 1e-05.

Examples

>>> close(1., 1.001)
False
>>> close(1., 1.001, tol=1e-2)
True