libm---log(negative)
Steve Hubert
hubert at entropy.UUCP
Sat Feb 9 05:04:10 AEST 1985
Libm says log(negative) = -HUGE and sqrt(negative) = 0.
Both set errno = EDOM which is reasonable. I guess the values
0 and -HUGE must come from the idea that the functions should
be continuous at zero or some voodoo like that.
If I am not mistaken, Fortran programmers are used to being yelled at
when they try to pass an out-of-domain argument to a function.
C programmers, as always, are a different story. Anyway, does anyone,
besides me, think it would be a good idea to explicitly warn the user
when s/he attempted to call log with a negative argument? If so,
have you come up with a smooth way of doing it?
Steve Hubert
Dept. of Stat., U. of Wash, Seattle
{allegra,decvax,ihnp4,ucbvax!lbl-csam}!uw-beaver!entropy!hubert
hubert%entropy at uw-beaver
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list