delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/01/14/12:15:00

Message-ID: <B0000063079@stargate.astr.lu.lv>
From: "Andris Pavenis" <pavenis AT lanet DOT lv>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com
Date: Thu, 14 Jan 1999 19:14:43 +0200
MIME-Version: 1.0
Subject: Re: What should libm functions return for bad args
In-reply-to: <Pine.SUN.3.91.990114152852.23744B-100000@is>
X-mailer: Pegasus Mail for Win32 (v3.01d)
Reply-To: djgpp-workers AT delorie DOT com

On 14 Jan 99, at 15:45, 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:
> 
> 	awk 'BEGIN { print log(0), log(-1), log(100) }'
> 	awk 'BEGIN { print exp(0), exp(1000000), exp(0.5) }'
> 
> If Gawk is installed on the target system, try Gawk; if not, try Awk.
> 

Results on RS6000 (system AIX-4.3) with both GNU AWK and native AWK

$ gawk --version
GNU Awk 3.0.3
Copyright (C) 1989, 1991-1997 Free Software Foundation.
$
$ gawk 'BEGIN { print log(0), log(-1), log(100) }'
gawk: cmd. line:1: warning: log called with negative argument -1
-INF NaNQ 4.60517
$ gawk 'BEGIN { print exp(0), exp(1000000), exp(0.5) }'
gawk: cmd. line:1: warning: exp argument 1e+06 is out of range
1 INF 1.64872



$ awk
Usage: awk [-F Character][-v Variable=Value][-f File|Commands][Variable=Value|F]
$ awk 'BEGIN { print log(0), log(-1), log(100) }'
-INF awk: 0602-544 The log parameter to a math library function is not in the d.
 The source line number is 1.
1 4.60517
$ awk 'BEGIN {print log(0), log(-1), log(100) }' 2>/dev/null
-INF 1 4.60517
$ awk 'BEGIN { print exp(0), exp(1000000), exp(0.5) }'
1 awk: 0602-545 The exp return value of a math library function is out of range.
 The source line number is 1.
1 1.64872
$ awk 'BEGIN {print exp(0), exp(1000000), exp(0.5) }' 2>/dev/null
1 1 1.64872
$ uname -a
AIX ieva01 3 4 00000424A400
$

- Raw text -


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