help-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Make division by zero legal


From: Peng Yu
Subject: Make division by zero legal
Date: Sun, 1 Aug 2021 12:23:57 -0500

Hi,

https://en.wikipedia.org/wiki/Division_by_zero

The above page says.

"The IEEE floating-point standard, supported by almost all modern
floating-point units, specifies that every floating-point arithmetic
operation, including division by zero, has a well-defined result. The
standard supports signed zero, as well as infinity and NaN (not a
number)."

$ awk -e '{print 1/0 }'
awk: cmd. line:1: error: division by zero attempted

But awk does not treat the above division as legal. Should this be
changed so that it gives less surprising results?

In the meantime, what is the best walkaround to get awk conformed to
the IEEE standard?

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]