Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: log function Message-ID: <6448@goanna.cs.rmit.oz.au> Date: 21 Jun 91 12:14:50 GMT Article-I.D.: goanna.6448 References: <1991Jun21.113211@cs.utwente.nl> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 27 In article <1991Jun21.113211@cs.utwente.nl>, stadt@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 look like? Does lint tell you anything interesting? -- I agree with Jim Giles about many of the deficiencies of present UNIX.