|
From: Daniel J S. <dan...@ie...> - 2006-06-02 17:15:29
|
Just wondering if the complaint
gnuplot> print 3.0!
factorial (!) argument must be an integer
is necessary or whether gnuplot could be programmed to check if the float is a whole number first and then go forward with the computation, if not then complain.
It would be a simple matter of convenience so that rather than doing this
gnuplot> set samples 101
gnuplot> plot [0:100] log(floor(x+0.5)!)
one could type the following and not get a complaint
gnuplot> plot [0:100] log(x!)
factorial (!) argument must be an integer
[Note, if there is some rounding error from an internal computation of the sample points, e.g., 1.0000000001 gnuplot should still complain, but in most reasonable limit choices I doubt that will happen.]
...
Also, just curious. I'm not familiar with any type of factorial for negative integers. If there is, I've not heard of it. (There's the gamma function and all, but that technically isn't the definition of factorial for negative integers.) Should gnuplot be giving this kind of result?
gnuplot> print -3!
-6.0
Dan
|