Anonymous user
Arithmetic evaluation: Difference between revisions
→{{header|F_Sharp|F#}}
Line 1,509:
|> eval
|> printfn "%d"</lang>
=={{header|FBSL}}==
Not only can ExecLine() calculate simple arithmetics but it can also compute anything that FBSL proper is able to compute using the entire range of intrinsic, user-defined and DLL-imported constants and functions of virtually any complexity.
'''One-liner maths evaluator solution:'''
<lang qbasic>#APPTYPE CONSOLE
DIM buffer AS STRING * 1024
SCANF("%s", buffer)
EXECLINE("PRINT "">>> "", " & buffer)
PAUSE</lang>
'''Output:'''
<pre>1+2*(3+(4*5+6*7*8)-9)/10+(SIN(PI)+COS(M_TWOPI))/SQRT(M_PI_2)
>>> 71.7978845608029
Press any key to continue...</pre>
=={{header|Go}}==
|