DiscoPants
Programmer
Hello, I wonder if anybody can help? Below is a simple command to print a mathematical equation giving the correct return:-
> echo "a" | awk '{ print(70.57 * 100) }'
7057
If I try and format this using a decimal integer I get the wrong return:-
echo "a" | awk '{ printf("%d\n", 70.57 * 100) }'
7056
Is this a bug or is there someting I blatantly missing and should quit computers?
> echo "a" | awk '{ print(70.57 * 100) }'
7057
If I try and format this using a decimal integer I get the wrong return:-
echo "a" | awk '{ printf("%d\n", 70.57 * 100) }'
7056
Is this a bug or is there someting I blatantly missing and should quit computers?