Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.

Fix overflow at project::operator()#89

Open
pozdnyakov wants to merge 1 commit into
masterfrom
mikhail_fix_overflow_at_project
Open

Fix overflow at project::operator()#89
pozdnyakov wants to merge 1 commit into
masterfrom
mikhail_fix_overflow_at_project

Conversation

@pozdnyakov

Copy link
Copy Markdown
Contributor

@pozdnyakov pozdnyakov requested a review from mourner December 5, 2018 16:29
@pozdnyakov pozdnyakov force-pushed the mikhail_fix_overflow_at_project branch from b75f25e to 85a426e Compare December 5, 2018 16:31
@pozdnyakov

Copy link
Copy Markdown
Contributor Author

This issue is detected by sanitizer when passing the tests.

@mourner mourner left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Contributor

@pozdnyakov which variable overflows here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants