I'm working on a simple calculator application. But the trigonometric functions in dart when working with the machine-pi values give values, such as, tan90 gives 16331239353195370.0 and cos90 gives 6.123233995736766e-17.
I am simply converting degrees to radians using angle_in_degree * (math.pi / 180)
for feeding the dart trigonometric functions.
I want to somehow approximate (or round off) these values, such that the output is similar to: 0 for cos90, infinite for tan90, etc. How can I efficiently and accurately do this?