AWK is an interpreted language aimed to the post processing of files. It is very usefull when, for example, you need to take out a column from a multicolumn format file, or for example capitalize different fields in a record.
It has lots of goodness due to its simplicity and you can write very useful oneliners.
But.... it fails dramatically in arithmetics, and most of all in floating point number calculations.
One problem that I discovered recently (after loosing days to find the error in my scripts) is that
it fails in the comparison of negative floating point numbers, for example, for AWK you would have:
-4.3 > -10.5
-4.3 < -9.1
That is like this because Awk seems to be comparing the positive of the first significative component of a number.
I also discovered some failures in floating point division. But I didnt investigate it much.
It is a shame that AWK creators (one of them the creator of the C language) Didń't care enough for AWK to manipulate floating points correctly. It limits enormously its aplicability and usability.
It has lots of goodness due to its simplicity and you can write very useful oneliners.
But.... it fails dramatically in arithmetics, and most of all in floating point number calculations.
One problem that I discovered recently (after loosing days to find the error in my scripts) is that
it fails in the comparison of negative floating point numbers, for example, for AWK you would have:
-4.3 > -10.5
-4.3 < -9.1
That is like this because Awk seems to be comparing the positive of the first significative component of a number.
I also discovered some failures in floating point division. But I didnt investigate it much.
It is a shame that AWK creators (one of them the creator of the C language) Didń't care enough for AWK to manipulate floating points correctly. It limits enormously its aplicability and usability.
