Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Epsilon, add IsZeroApprox semantic, and update to Unity 2018.3.14f1 #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aaronfranke
Copy link

  • 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 formula 53*log(2) gives 15.95, so a value of 1e-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 than Epsilon 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)

@aaronfranke aaronfranke changed the title Fix Epsilon, add IsZeroApprox sematic, and update to Unity 2018.3.14f1 Fix Epsilon, add IsZeroApprox semantic, and update to Unity 2018.3.14f1 Oct 29, 2019
@Karth42
Copy link
Owner

Karth42 commented Nov 3, 2019

thanks you very much for your effort to improve this project, but unfortunately this repository is not open for contributions. however I will leave your pull request open so your fork will be more visible to random visitors.

@aaronfranke
Copy link
Author

but unfortunately this repository is not open for contributions.

Would you mind placing that in the README file?

@Karth42
Copy link
Owner

Karth42 commented Nov 3, 2019

sure.

Also save Vector3d.cs as UTF-8
One newline character at the end, and UTF-8, as per POSIX standard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants