Add files via upload
This commit is contained in:
parent
d718358ff5
commit
e7c14517c9
1 changed files with 8 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ import numpy as np
|
|||
def RPN_to_eq(expr):
|
||||
|
||||
variables = ["0","1","a","b","c","d","e","f","g","h","i","j","k","l","m","n","P"]
|
||||
operations_1 = [">","<","~","\\","L","E","S","C","A","N","T","R"]
|
||||
operations_1 = [">","<","~","\\","L","E","S","C","A","N","T","R","O","J"]
|
||||
operations_2 = ["+","*","-","/"]
|
||||
|
||||
stack = np.array([])
|
||||
|
|
@ -66,4 +66,10 @@ def RPN_to_eq(expr):
|
|||
if i=="R":
|
||||
a="sqrt("+a+")"
|
||||
stack = np.append(stack,a)
|
||||
return(stack[0])
|
||||
if i=="O":
|
||||
a="(2*("+a+"))"
|
||||
stack = np.append(stack,a)
|
||||
if i=="J":
|
||||
a="(2*("+a+")+1)"
|
||||
stack = np.append(stack,a)
|
||||
return(stack[0])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue