We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
$ awk --version | head -1 GNU Awk 5.1.1, API: 3.1 (GNU MPFR 4.1.0-p13, GNU MP 6.2.1)
The example indeed prints 0.3, but 0.1 + 0.2 != 0.3:
$ awk 'BEGIN { print 0.1 + 0.2 }' 0.3 $ awk 'BEGIN { print (0.1 + 0.2) == 0.3 }' 0
It's because
$ awk 'BEGIN { printf "%0.25f", 0.1 + 0.2 }' 0.3000000000000000444089210 $ awk 'BEGIN { printf "%0.25f", 0.3 }' 0.2999999999999999888977698
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The example indeed prints 0.3, but 0.1 + 0.2 != 0.3:
It's because
The text was updated successfully, but these errors were encountered: