From: Tim W. <ti...@ie...> - 2010-02-08 15:53:39
|
On Mon, Feb 08, 2010 at 07:15:21AM -0800, Philipp K. Janert wrote: > On Sunday 07 February 2010 11:07:07 am Tim Wojtulewicz wrote: > > I'm working with a fairly complicated function, one part of which is the > > division of two factorials. I'm having an issue with though, because > > gnuplot keeps returning NaN for what should be a simple division. It will > > return NaN for something as simple as 100!/99!, which should just be 100. > > Is there a reason for this, or an easy way to fix it? Thanks. > > The intermediate results overflow, despite the fact that > the final result is of meaningful size. > > Either work out the cancellations analytically, or work with > logarithms of all quantities (Stirlings approximation!), and > exponentiate at the end (if needed). > So is this a version issue then? The reply from Thomas seems like his is working correctly. I'm working with version 4.2.5 on OS X 10.6. It's odd that his would work, and yet mine won't. Tim |