|
From: Daniel J S. <dan...@ie...> - 2010-12-29 17:30:29
|
Juhász Péter wrote:
> On Tue, 2010-12-28 at 16:36 -0600, Daniel J Sebald wrote:
[snip]
>>Actually, my observation is that functions having real arguments will reject string inputs while functions with optional complex arguments will not reject string inputs. For example
>>
>>gnuplot> print gamma("test")
>>
>>gnuplot> print gamma("test")
>> ^
>> undefined value
>>
>>gnuplot> print erfc("test")
>>1.0
>>
>
>
> I think this is not true.
>
> # optional complex argument
> gnuplot> pr sin({2,3})
> {9.15449914691143, -4.16890695996656}
>
> # croaks on meaningless strings
> gnuplot> pr sin("foo")
> Non-numeric string found where a numeric expression was
> expected
>
> # works with meaningful strings
> gnuplot> pr sin("3")
> 0.141120008059867
Sounds like gnuplot needs some consistency in how this is handled.
>>>Its effect is the same as that of
>>>rand(0) - which have misled the user in the thread[1], because he
>>>thought that rand("time") sets the random seed to the current time.
>>
>>Are you proposing there should be an input argument "time"?
>
>
> No, but now that you mention it, I've found it frustrating that there is
> no way within gnuplot to get the current time, one has to resort to an
> external application. There is already an extensive framework in place
> for formatting date&time strings, there is even a way to put the current
> time as a time stamp on the plot, but there is no way to get it as a
> variable (for example). There ought to be a time() function that returns
> the current gnuplot time (seconds since 2000), the existing formatting
> functions are adequate to transform that into any other format.
Good point. Tagging a plot with the current time does seem like something of value.
Dan
|