Closed Saikedo closed 4 years ago
Would doing a try, catch and returning the limit of the function if it's an undefined error work?
Important question: Should Infinity or -Infinity be returned? Different limits from different directions. We can add a UnknownSignInfinity
though.
Or ComplexInfinity
like Wolfram Alpha.
@Happypig375 Can we somehow distinguish between the negative and positive infinities when returning? It would be great if we can indicate the sign of the infinity.
Infinity
and -Infinity
are both in Nerdamer. However, tan(pi/2)
is Infinity
when approached from the left hand side, -Infinity
from the right hand side. Both answers are incorrect if you consider the other case. ComplexInfinity
, which is an infinity with unknown sign, is best as the answer.
@Saikedo, what was your approach ultimately with this issue?
There are numerous cases where nerdamer throws an error instead of returning infinity. One example is tan(pi/2). So just for tan(pi/2) it is fine to return an error saying it is not defined but we start getting issues with expressions such as 1/(tan(pi/2)). All the other calculators are returning 0 for this value since tan(pi/2) goes to positive infinity.
Is this something that can be easily fixed? Any suggestings on how these situations can be handled?