serso / android-calculatorpp

Android Calculator
421 stars 204 forks source link

Please add round(x,a) function #162

Open rafyco opened 9 years ago

thabubble commented 1 year ago

In case anyone else need this. The workaround I use are custom functions:

tmod(x, y) = y/2-y/π*atan(cot(π*x/y))

(Because mod doesn't evaluate in custom functions. Seems accurate enough from what I've seen.)

floor(x) = x-tmod(x, 1) round(x, y) = floor(0.5+x*10^y)/10^y