For example, you can let the user enter something like "4*(5+6)-sin(1/3*pi)" and the dll will calculate the result.

The calculator supports:

- Standard operators: +, -, * and /

- Scientific notation (1.52e8)

- Brackets

- Functions (see function list below)

- Constants

The dll also contains functions for converting strings to reals and reals to strings, as the standard GM functions are very limited and often crash if the numbers are too large.

The syntax and functions supported by the dll work the same as in GM. The following functions are supported:

abs(x)

sign(x)

round(x)

floor(x)

ceil(x)

frac(x)

sqrt(x)

sqr(x)

power(x,n)

exp(x)

ln(x)

log2(x)

log10(x)

logn(n,x)

sin(x)

cos(x)

tan(x)

arcsin(x)

arccos(x)

arctan(x)

arctan2(y,x)

degtorad(x)

radtodeg(x)

mod(x,divisor)

div(x,divisor)

min(x1,x2,x3,...)

max(x1,x2,x3,...)

mean(x1,x2,x3,...)

median(x1,x2,x3,...)

point_distance(x1,y1,x2,y2)

point_direction(x1,y1,x2,y2)

lengthdir_x(len,dir)

lengthdir_y(len,dir)

The dll also supports constants pi and e.

Download: Calculator Dll - ZIP (38.3kb)

The zip file contains the dll (and scripts), the extension, an example (gmk) and a help file.

**Edited by Maarten Baert, 17 September 2012 - 11:34 AM.**