You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Determine if two numbers are within tolerance of each other * @param {number} a * @param {number} b * @param {number} tolerance * @returns {boolean} */functionisApproxEqual(a,b,tolerance){returnMath.abs(a-b)<=tolerance;}
This seems like it could be generally useful. For #398.
The text was updated successfully, but these errors were encountered:
Jesse Greenberg [6:10 PM]
EnergySkateParkBasicsModel has an `isApproxEqual` function that returns true if two values are equal within a tolerance. Seems generally useful, and I would move it to dot/Util. Others OK with this?
Jonathan Olson [6:13 PM]
hah, I have equalsEpsilon as a function on most dot types, but don't have it for basic numbers. Feel free to add it
Jesse Greenberg [6:14 PM]
Cool, call it equalsEpsilon in Util?
Jonathan Olson [6:15 PM]
Sure, sounds good. (Should we rename them in general to isApproxEquals? Might be easier to find/understand)
Jesse Greenberg [6:17 PM]
I don't think it is worth a rename, my first search would be "equal" and I would fine equalsEpsilon that way
This seems like it could be generally useful. For #398.
The text was updated successfully, but these errors were encountered: