RosettaCodeData/Task/Arithmetic-evaluation/E/arithmetic-evaluation-2.e

9 lines
144 B
Plaintext

? arithEvaluate("1 + 2")
# value: 3
? arithEvaluate("(1 + 2) * 10 / 100")
# value: 0.3
? arithEvaluate("(1 + 2 / 2) * (5 + 5)")
# value: 20.0