Mail Archives: djgpp/2001/01/11/12:21:41
On Thu, 11 Jan 2001, Tanes Sriviroolchai wrote:
> gcc -o test1.exe test1.c
> when running you will get
>
> NaN
>
> This is expected result. However if I compile using
> gcc -o test1.exe test1.c -lm
> and then running, you will get
>
> -Inf
This is what log() from libm.a is documented to produce. Here's the
relevant excerpt from libm.info:
Return Value
-------------
Normally, returns the calculated value. When X is zero, the
returned value is `-HUGE_VAL' and `errno' is set to `ERANGE'. When X
is negative, the returned value is `-HUGE_VAL' and `errno' is set to
`EDOM'. You can control the error behavior via `matherr'.
- Raw text -