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 overflow at project::operator() #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pozdnyakov
Copy link
Contributor

@pozdnyakov pozdnyakov force-pushed the mikhail_fix_overflow_at_project branch from b75f25e to 85a426e Compare December 5, 2018 16:31
@pozdnyakov
Copy link
Contributor Author

This issue is detected by sanitizer when passing the tests.

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the sanitizer error is division by zero, can we avoid it without introducing an epsilon? E.g. if (sine == 1.0) return 1.0;

@pozdnyakov
Copy link
Contributor Author

If the sanitizer error is division by zero, can we avoid it without introducing an epsilon? E.g. if (sine == 1.0) return 1.0;

std::sin could give us 0.9999999999999... that won't be exactly 1.0 but will still lead to an overflow error, epsilon solution looks safer.

@maxammann
Copy link
Contributor

@pozdnyakov which variable overflows here?

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.

3 participants