bug-gawk
[Top][All Lists]
Advanced

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

Support of log10?


From: Peng Yu
Subject: Support of log10?
Date: Wed, 23 Jun 2021 17:03:44 -0500

$ seq 3 | awk -v 'OFS=\t' -v OFMT=%.20g -e 'function log10(x) { return
log(x)/log(10); } { print "log10(" 10^$1 ")", log10(10^$1) }'
log10(10)       1
log10(100)      2
log10(1000)     2.9999999999999995559

I don't find a native support of log10(). But if I implement log10
with log, I got the above problem. The result of log10(1000) should be
exact 3. But it is not.

Is it worthwhile to consider the support of log10 in gawk?

-- 
Regards,
Peng



reply via email to

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