log function

Richard A. O'Keefe ok at goanna.cs.rmit.oz.au
Fri Jun 21 22:14:50 AEST 1991


In article <1991Jun21.113211 at cs.utwente.nl>, stadt at cs.utwente.nl (Richard van de Stadt) writes:
> I get the error message
> log: SING error
from
> store_control_parameter (mean / log (1/get_acceptance_ratio_X0()))
> Does anybody know what the error message means?

If you R the FM (it looks as though you're using System V, so the FM in
question is 'man 3 exp' or 'man 3 matherr', I looked up the SVID v1) it
tells you that SING from log() or log10() means that the argument is
not positive.

> The same message appears when I split up the statement:
> tolog = 1/get_acceptance_ratio_X0();   /* tolog has then value 1.25 */
> loggie = log (tolog);  /* now this is the statement that causes the message */

This is very strange.  Have you tried writing a program that just evaluates
log(1.25) and seeing what it does?

By the way, I note that log(1/x) = -log(x), so
	store_control_parameter(-mean/log(get_acceptance_ratio_X0()));
should compute the same thing.  Does it fail the same way?

What does the declaration of log() in your <math.h> look like?
Does lint tell you anything interesting?
-- 
I agree with Jim Giles about many of the deficiencies of present UNIX.



More information about the Comp.lang.c mailing list