-
Notifications
You must be signed in to change notification settings - Fork 553
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
"Lost precision" warnings on increment/decrement #18333
Comments
t-a-k
added a commit
to t-a-k/perl5
that referenced
this issue
Dec 7, 2020
Previously, imprecision warnings on increment (Lost precision when incrementing %f by 1) were only issued on positive finite values, and, on decrement, only issued on negative finite values. This commit extends this warnings on both sign and infinite values. This fixes GH Perl#18333.
khwilliamson
pushed a commit
that referenced
this issue
Dec 29, 2020
Previously, imprecision warnings on increment (Lost precision when incrementing %f by 1) were only issued on positive finite values, and, on decrement, only issued on negative finite values. This commit extends this warnings on both sign and infinite values. This fixes GH #18333.
t-a-k
added a commit
to t-a-k/perl5
that referenced
this issue
Dec 29, 2020
khwilliamson
pushed a commit
that referenced
this issue
Dec 29, 2020
Corion
pushed a commit
to Corion/perl5
that referenced
this issue
Jun 20, 2021
Previously, imprecision warnings on increment (Lost precision when incrementing %f by 1) were only issued on positive finite values, and, on decrement, only issued on negative finite values. This commit extends this warnings on both sign and infinite values. This fixes GH Perl#18333.
Corion
pushed a commit
to Corion/perl5
that referenced
this issue
Jun 20, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
"
Lost precision when incrementing ... by 1" warning on increment seems to be limited to the case that the target value was positive finite value; infinity or negative large value are not warned. (Similarly, infinity or positive large value are not warned on decrement.)I think this is somewhat inconsistent.
Steps to Reproduce
The second and third example above shows that target variable are not changed, but no warnings are generated.
Expected behavior
I expect that perl will warn if increment cannot change the value even for infinite or negative values, and for decrement, warn even for infinite or positive values.
Perl configuration
The text was updated successfully, but these errors were encountered: