[Kst] Equation parser decisions to make

Barth Netterfield netterfield at astro.utoronto.ca
Mon Nov 22 22:08:02 CET 2004


On Monday 22 November 2004 14:39, George Staikos wrote:
> 1)
> Test of ()[1.0000000000000000] == 0.0000000000000000 failed.
>
>   Do we allow empty equations?  If so what do they evaluate to? 0? 
> NOPOINT?

We shouldn't allow them.   If they happen, NOPOINT sounds good to me.

> 2)
> Result: 0.7540103247897930
> Test of (asin(sin(x)))[2.3875823288000002] == 2.3875823288000002 failed.

Phase -> asin is multi-valued.
sin(2.3875823288000002) = 0.68456758087715
sin(0.7540103247897930) = 0.68456758087715
Plot sin(x) from -10 to 10 to see the effect.

kst is doing the correct thing here - the test is bad.

>    Still haven't figured out what's up with this one.
>
> 3)
> Result: 0.0000000000000000
> Test of (!x)[nan] == 1.0000000000000000 failed.
>
>    What should the result of !NOPOINT be?  I think it should be true, but
> right now it's false.

Concur.  Should be true.

> 4)
> Result: -1.0000000000000000
> Test of (-1|257)[0.0000000000000000] == 257.0000000000000000 failed.
> Result: -1.0000000000000000
> Test of (257|-1)[0.0000000000000000] == 257.0000000000000000 failed.
>
>    What do we want the result of bitwise ops with negative numbers to be?

It becomes encoding specific.  -1 == 0xffff ffff is a perfectly usual 
definition (true on any arch I know). (2's complement) so I am ok with 
leaving it as is.

> 5)
> Test of (foo(3,)) parsing passed, but should have failed.
> Test of (foo(3,,5)) parsing passed, but should have failed.
>
>    Should we allow empty arguments to functions and plugins?  If so, what
> do we put there?

Empty should be disallowed unless we allow optional parameters (I don't think 
we do).



More information about the Kst mailing list