Fix Epsilon, add IsZeroApprox semantic, and update to Unity 2018.3.14f1 #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing value for
Epsilon
is too small to be useful for float comparison. Double-precision floats have 53 significant digits including the implicit bit, and the formula53*log(2)
gives15.95
, so a value of1e-14
is appropriate as it has a decent margin of error.In an effort to increase code readability, I've added an
IsZeroApprox
semantic for when you need to check if a number is less thanEpsilon
but greater than-Epsilon
. C# will optimize this method away so there's no performance hit.Ensure all files are saved as proper UTF-8 with newline characters at the end of each file. Previously GitHub showed warnings and failed to interpret
Vector3d.cs
as a text file.Update project to Unity 2018.3.14f1 (previously was 2018.3.7f1, so only a patch release change)