www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/01/15/21:25:43

Sender: nate AT cartsys DOT com
Message-ID: <369FF77E.534E377B@cartsys.com>
Date: Fri, 15 Jan 1999 18:20:46 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.0.36 i586)
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: What should libm functions return for bad args
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990114152852 DOT 23744B-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019