RosettaCodeData/Task/Runtime-evaluation-In-an-environment/Ring/runtime-evaluation-in-an-environment.ring

8 lines
194 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
expression = "return pow(x,2) - 7"
one = evalwithx(expression, 1.2)
two = evalwithx(expression, 3.4)
see "one = " + one + nl + "two = " + two + nl
func evalwithx expr, x
return eval(expr)