Possible std.math.exp() bug

Don Clugston dac at nospam.com.au
Tue Apr 4 07:19:07 PDT 2006


anthony.difranco at yale.edu wrote:
> Thanks.  I was actually using your tgamma from dsource. 

Cool! I hope to make an official release of the mathextra libraries 
sometime soon. Some of the functions in std.complex have known issues, 
but the statistics ones are very well tested.

Good to have another mathematics programmer around!

  I was also looking for
> documentation for format 
> strings for printf but found none in std.c.printf or std.string sections - where
> is that covered?

It's in the docs for the DMC standard library. There are a few things 
like this that aren't included in the downloaded docs, and which should 
at least be linked to.

http://www.digitalmars.com/rtl/stdio.html#fprintf

> 
> Also, is there a better way to do the ratio of two gammas than subtracting
> lgammas and exp at the end?

Do you mean, more accurate way? If the numbers are not too large, I 
don't think it matters much, even a simple division of the tgammas is 
probably OK, but lgamma() will save you from overflow problems.
If the arguments are large, the Stirling approximation is used, so there 
may be potential for greater accuracy. I'd be amazed if it actually 
mattered, though.



More information about the Digitalmars-d-bugs mailing list