-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Floating point modulo producing incorrect compuations #111405
Copy link
Copy link
Open
Labels
A-floating-pointArea: Floating point numbers and arithmeticArea: Floating point numbers and arithmeticC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-floating-pointArea: Floating point numbers and arithmeticArea: Floating point numbers and arithmeticC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected the assert to pass.
Instead, this happened:
Meta
This is most likely due to division being rounded, but mod not. This caused a bug in a sin table function I was writing.
This is standard libc behavior but it is still not correct and can cause bugs where none are expected.
rustc --version --verbose:Backtrace