ScratchData LogoScratchData
Back to DarthPickley's profile

Prefix Calculator

DADarthPickley•Created September 3, 2010
Prefix Calculator
1
0
6573 views
View on Scratch

Description

wikipedia if you don't know what prefix is. basically, though, it's like instead of saying "a+b", you say "+ab", and instead of saying "(a+b)*(a-b)", you say "*(+ab)(-ab)", which, under the prefix order of operations, is equal to just "*+ab-ab". This calculator uses expressions entered in prefix notation, spaces seperating operators and operands, and with no parentheses, although you can fully parenthesize an infix expression, change to prefix, and then get rid of the parentheses if you want. It is probably easier that way if you don't usually use prefix notation in your writing expressions (which you would if you used perl). Click the Enter button to enter. you can see what operations there are and which are unary vs. binary (one or two arguments) negation and subtraction are different symbols, since one is unary and one is binary. negation is just two dashes: "--". For example, if you want to say "-sqrt(2)", you enter "-- sqrt 2", and if you want to say "sqrt(3)-sqrt(2)", you enter "- sqrt 3 sqrt 2" VARIABLES this comes with two constants, pi and e. you can create and change the values of other variables you can use in your expression. Also, if your expression contains a variable that hasn't been defined, then that variable will be created and given a default value of 0 right before the expression is evaluated. After evaluating an expression, you must re-enter it again to re-evaluate. I might change this. by the way: the purpose of this project is not as much for usefulness as it is for experiment. Paddle2See already has a great Infix calculator. However, this one is completely made by me, and I want to know that I am able to do such things. enjoy. If you like this, say so, I guess...

Project Details

Project ID1279202
CreatedSeptember 3, 2010
Last ModifiedSeptember 3, 2010
SharedSeptember 3, 2010
Visibilityvisible
CommentsAllowed