|
From: Ethan A M. <merritt@u.washington.edu> - 2006-05-30 00:22:56
|
On Monday 29 May 2006 03:28 pm, Daniel J Sebald wrote:
> This seems like a bug, even though the syntax is incorrect... but a user might think the syntax is correct if gnuplot doesn't complain but rather returns a non-zero value that will always test positive.
>
> gnuplot> print defined("foo")
> 141158968
We don't have a user-visible TBOOLEAN type,
so any non-zero value represents "TRUE"
> Also, would it be useful to extend defined() from just variables to functions as well?
> Say, return 1 if user defined variable, 2 if internal variable, 3 if user defined function,
> 4 if internal function.
What would you do with this information?
> That way, the defined() function could be used inside stat.inc as
>
> if (defined(gamma)!=3) gamma(x) = exp(lgamma_nat(x))
But that will always be true.
The conditional compilation is set during configuration so that you
always get a gamma function. The only question is whether you get
one from a system library or whether you get one from gnuplot's
inline code.
> then get rid of these comments like:
>
> # If you have the lgamma() function compiled into gnuplot
> As soon as someone starts uncommenting/commenting code it becomes confusing.
That comment is confusing to me already. My reading of the
code leads me to believe that gnuplot will always provide a
lgamma() function. Again there is a question of whether this
came from a system library or not. But either way you can
use the function.
> , you can use
> # alternate definitions for some PDFs. For larger arguments this will result
> # in more efficient evalution. Just uncomment the definitions containing the
> # string `lgamma', while at the same time commenting out the originals.
> # NOTE: In these cases the recursive definition for lgamma() is NOT sufficient!
>
>
>
> Last, how about an internally defined 'eps' or something similar to represent float machine precision?
>
>
> Oh, one other thing. Any interest in a complex version of the gamma function?
>
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|