Mail Archives: djgpp-workers/1999/01/15/21:25:43
Eli Zaretskii wrote:
> So please try the following two Awk commands on as many Unix/Linux
> platforms as you can gain access and tell me what do they print:
>
> nawk 'BEGIN { print log(0), log(-1), log(100) }'
> nawk 'BEGIN { print exp(0), exp(1000000), exp(0.5) }'
>
> If Gawk is installed on the target system, try Gawk; if not, try Awk.
This is for a SunOS 5.6 machine. There are two `awk's installed: `awk'
and `nawk'. Neither is GNU.
$ uname -a
SunOS users 5.6 Generic sun4c sparc SUNW,Sun_4_50
$ awk 'BEGIN { print log(0), log(-1), log(100) }'
log: SING error
log: DOMAIN error
-3.40282e+38 -3.40282e+38 4.60517
$ awk 'BEGIN { print exp(0), exp(1000000), exp(0.5) }'
1 3.40282e+38 1.64872
$ nawk 'BEGIN { print log(0), log(-1), log(100) }'
log: SING error
nawk: log argument out of domain
source line number 1
1 log: DOMAIN error
nawk: log argument out of domain
source line number 1
1 4.60517
$ nawk 'BEGIN { print exp(0), exp(1000000), exp(0.5) }'
1 nawk: exp result out of range
source line number 1
1 1.64872
$
And this is for an SGI Indy running Irix 6.2. It has just a `nawk', to
which `awk' is a symlink.
Indy 2% awk 'BEGIN { print log(0), log(-1), log(100) }'
log result out of range
Source line number 1
1 log argument out of domain
Source line number 1
1 4.60517
Indy 3% awk 'BEGIN { print exp(0), exp(1000000), exp(0.5) }'
1 exp result out of range
Source line number 1
1 1.64872
Indy 8% uname -a
IRIX Indy 6.2 03131015 IP22
HTH
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -