On Thu, 18 Oct 2001, fooler wrote:

> > NEGATE is the lowest priority, together with + and -.
> > So ~3 ^ 2 evaluates as ~9.
> ok so you diffirentiate between negate and unary plus/minus. isnt negate is
> dealing more on boolean properties and not in numeric properties?

You did not read the website properly.
NEGATE is the same as ~, which is the same as unary minus
(its just a name).  The reason why I use ~ is because I do not
have a true grammar-based parser, and I have to find a way
of differentiating between unary minus (~) and binary subtraction(-).
It is too expensive to use bison, since Palm has only 4K for data
(globals+stack).

+ is for binary addition.  - is for binary subtraction.

~, +, and - have the same priority.

At least, those are the rules of my calculator program.

I think I should write the rules more clearly, but if you actually
run the program, tap on Menu -> Help -> Summary, and you get
a one-page summary of correct usage of the calculator.

I should rewrite the program to use more standard notation,
namely - for both unary negate and binary subtraction, but
I don't have as much time as I used to have.  Too much to do.

PMana

_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to