-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: outdated, incorrect documentation about the order of precedence for
operator modulus `%`. See #3189
- Loading branch information
Showing
3 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
599f4ee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
% Has the priority order issue been fixed .I retested using this version and the calculation result is still wrong.
599f4ee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation did not correspond to the actual behavior like discussed in #3189. That has been fixed in this commit.
The actual behavior itself is not "broken", though the precedence may be differing from what you want. On some points, different math applications use different rules for precedence. In case of doubt you can use parenthesis like
(250/10) % 10
.Like I pointed out in #3189 (comment), if you want you can open a discussion to see if we should change this behavior.