Janis Papanagnou
2023-01-20 09:56:19 UTC
In an article about "AWK As A Major Systems Programming Language"[*]
(in chapter 5.3 "Future Work") we can read:
"Some issues are known and may not be resolvable. For example,
64-bit integer values such as the timestamps in stat() data on
modern systems don’t fit into awk’s 64-bit double-precision
numbers which only have 53 bits of significand. This is also a
problem for the bit-manipulation functions."
I was a bit astonished to read that; I thought that IEEE 80-bit FP
(with a 64 bit mantissa) would be standard nowadays. Not in GNU Awk,
or, generally not in applications?
This (and other answers) on a SO post[**] may address the question:
"That is, you may have 32-bit or 64-bit variables, but when they
are loaded into the FPU registers, they are converted to 80 bit;
the FPU then (by default) performs all calculations in 80 but;
after the calculation, the result is stored back into a 32-bit
or 64-bit variables."
So it's standard only in FPUs and losses are accepted when passing
values from FPUs to memory entities (presumably for performance
reasons)?
Janis
[*] http://www.skeeve.com/awk-sys-prog.html
[**]
https://stackoverflow.com/questions/612507/what-are-the-applications-benefits-of-an-80-bit-extended-precision-data-type
(in chapter 5.3 "Future Work") we can read:
"Some issues are known and may not be resolvable. For example,
64-bit integer values such as the timestamps in stat() data on
modern systems don’t fit into awk’s 64-bit double-precision
numbers which only have 53 bits of significand. This is also a
problem for the bit-manipulation functions."
I was a bit astonished to read that; I thought that IEEE 80-bit FP
(with a 64 bit mantissa) would be standard nowadays. Not in GNU Awk,
or, generally not in applications?
This (and other answers) on a SO post[**] may address the question:
"That is, you may have 32-bit or 64-bit variables, but when they
are loaded into the FPU registers, they are converted to 80 bit;
the FPU then (by default) performs all calculations in 80 but;
after the calculation, the result is stored back into a 32-bit
or 64-bit variables."
So it's standard only in FPUs and losses are accepted when passing
values from FPUs to memory entities (presumably for performance
reasons)?
Janis
[*] http://www.skeeve.com/awk-sys-prog.html
[**]
https://stackoverflow.com/questions/612507/what-are-the-applications-benefits-of-an-80-bit-extended-precision-data-type