help-gawk
[Top][All Lists]
Advanced

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

Re: Support of log10?


From: Peng Yu
Subject: Re: Support of log10?
Date: Sun, 15 Aug 2021 09:26:25 -0500

https://github.com/su8/gawk-extensions

log10 can be found in this gawk extension. But it seems that this repo
is not actively maintained. Does anybody know a well-maintained gawk
extension with the support of those math functions?

On Wed, Jun 23, 2021 at 5:03 PM Peng Yu <pengyu.ut@gmail.com> wrote:
>
> $ 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



-- 
Regards,
Peng



reply via email to

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