Greater or equal approx

Godot Version

4.2.1

Question

In case when I need to use >= with floas, for now I uses:

func bigger_or_equal_approx(v1: float ,v2: float):
	return v1 > v2 or is_equal_approx(v1, v2)

But does the engine have a native way to handle float imprecision in this case? I searched for info, and it looks like no. So why do we have is_zero_approx, but not is_greater_or_equal_approx? Did I miss something and not v1 < v2 may save the day?

No, I don’t think there’s a specific method to do it.

1 Like