You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d2fc4dc
Browse filesBrowse the repository at this point in the historyBrowse files
Compile a real remainder over double and float with one rounding (#2333)
The LINQ compiler wrote the floored remainder as ((a % b) + b) % b. Over
the integers that is exact; over double the second % rounds even where the
first remainder already had the divisor's sign. 2 mod e compiled to
1.9999999999999996, and floor(2 mod e) to 1, where both evaluate to 2.
Over double and float the remainder is now taken once and the divisor
added only where the signs differ, as RealOnly.Mod already did for Complex.
The integer types keep the exact expression.
Found by compilesweep at seed 11: pi / floor(2 mod e) compiled to pi.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments