bug-gnu-utils
[Top][All Lists]
Advanced

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

possible bug in awk's x^y


From: John Wheeler
Subject: possible bug in awk's x^y
Date: Fri, 28 Jan 2011 20:54:00 -0800
User-agent: Thunderbird 1.5.0.12 (X11/20101029)

I found in evaluating e = lim_{n-> inf} (1+1/n)^n
for n = 2^m
that gawk
1. became slow
2. failed to be accurate at about single precision arithmetic.
When I instead calculated exp(n*log(1+1/n))
it ran much faster and attained full double precision arithmetic.
When I tried
x = n + sqrt(3)
it ran fast, but again only produced single precision reliability.
This leads me to suspect there is a bug in the implementation of gawk's x^y.
Comments?
John Wheeler
address@hidden
858-699-2585



reply via email to

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