isClose default epsilon

I noticed that the documentation for Vector3:isClose() doesn’t say what the default epsilon is. I did some testing and I think it’s supposed to be 0.00001. I think it would be much more convenient for people if it was documented on the wiki. That way nobody has to fiddle around with numbers to figure out what it is.

Btw here’s the code to check what it actually is:

print("--|| Valid ||--")
local validVect = Vector3.new(.00001)
print("without arg:", validVect:isClose(Vector3.new()))
print("with arg:", validVect:isClose(Vector3.new(), .00001))

local invalidVect = Vector3.new(.0001)
print("\n--|| Invalid ||--")
print("without arg:", invalidVect:isClose(Vector3.new()))
print("with arg:", invalidVect:isClose(Vector3.new(), .00001))

The documentation also doesn’t list the epsilon argument as optional with square brackets. It seems it’s not supposed to be used without provided epsilon, as the default is more likely trying to be entirely equal with a margin for rounding errors.

EDIT: apparently square brackets are now replaced by arg = default value. Either way entry doesn’t use anything to denote it’s optional.

1 Like

Oh I see. That’s a fair point

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.