serso / android-calculatorpp

Android Calculator
421 stars 204 forks source link

tan(pi/2) = 1.6331239e+16 #148

Open valery-kirichenko opened 9 years ago

valery-kirichenko commented 9 years ago

Why so?

serso commented 9 years ago

The floating point arithmetic is used to evaluate the expressions. Thus, calculations always contain some "calculation" error which is defined by precision of double float numbers in Java (16 digits). As tan(pi/2) is evaluated numerically the result is a big number "close enough" to infinity.

wischi-chr commented 8 years ago

This should be closed. I can't reproduce this. tan(pi/2) evaluates to ∞