From: Martin Stromberg Message-Id: <200101120636.HAA14898@lws256.lu.erisoft.se> Subject: Re: Weird results of log( -1.0 ) with libm.a and without libm.a (fwd) To: djgpp-workers AT delorie DOT com Date: Fri, 12 Jan 2001 07:36:04 +0100 (MET) In-Reply-To: from "Eli Zaretskii" at Jan 11, 2001 07:25:04 PM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > > Someone complained about log() from libm producing -Inf for a negative > argument. It turns out that this is what the code is supposed to do, and > it is even documented in libm.info (type "info libm log"). > > Does anyone has an idea why this is the Right Thing to do? C89 says in 7.5.1: "On a domain error, the function returns an implementation-defined value, the value of the macro EDOM is stored in errno." So there does not seem to be any problem returning -Inf. Right, MartinS