You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a system for handling square roots. √2 for example.
The main issue with √ is with determining what portion of the expression it is trying to squre.
If we have 5 * √2a for example, are we taking the sqaure of 2 * a? Or the square of 2, multiplied by a?
I'm suggesting using a specific command such as sqrt() to handle this. So the tokenizer should consume the sqrt and handle the entire sub-expression before continuing on with the rest of the equation.
I.E:
5 * 2 +8 / sqrt(144*2) + 5
.... the tokenizer should push the sqrt open brack onto the operator stack, carry out the equation until it comes to a closing bracket. Then it should continue on with the remainder of the equation.
This would also allow for nested square roots.
17.5-8+16a+sqrt(144sqrt(144))*18/5.5
The text was updated successfully, but these errors were encountered:
We need a system for handling square roots. √2 for example.
The main issue with √ is with determining what portion of the expression it is trying to squre.
If we have 5 * √2a for example, are we taking the sqaure of 2 * a? Or the square of 2, multiplied by a?
I'm suggesting using a specific command such as sqrt() to handle this. So the tokenizer should consume the sqrt and handle the entire sub-expression before continuing on with the rest of the equation.
I.E:
5 * 2 +8 / sqrt(144*2) + 5
.... the tokenizer should push the sqrt open brack onto the operator stack, carry out the equation until it comes to a closing bracket. Then it should continue on with the remainder of the equation.
This would also allow for nested square roots.
17.5-8+16a+sqrt(144sqrt(144))*18/5.5
The text was updated successfully, but these errors were encountered: