OsApproxEquals
From OpenSimulator
(Difference between revisions)
| Line 11: | Line 11: | ||
|ossl_example=<source lang="lsl"> | |ossl_example=<source lang="lsl"> | ||
… | … | ||
| − | if(osApproxEquals(pos, otherpos)) // on Xengine use if(osApproxEquals(pos, otherpos) == 1) | + | if(osApproxEquals(pos, otherpos, 1e-2)) // on Xengine use if(osApproxEquals(pos, otherpos) == 1) |
| − | llOwnerSay("Positions are equal"); | + | llOwnerSay("Positions are almost equal"); |
... | ... | ||
</source> | </source> | ||
Revision as of 13:55, 20 February 2019
integer osApproxEquals(float a, float b)
integer osApproxEquals(vector va, vector vb) | |
| Returns 1 (true) if the quantities or all their components do not differ by the margin value, or 1e-6, if margin is not provided. Returns 0 (false) otherwise. | |
| Threat Level | None |
| Permissions | Use of this function is always allowed by default |
| Extra Delay | 0 seconds |
| Example(s) | |
… if(osApproxEquals(pos, otherpos, 1e-2)) // on Xengine use if(osApproxEquals(pos, otherpos) == 1) llOwnerSay("Positions are almost equal"); ... | |
| Notes | |
| Implemented November 20, 2018 | |