Open meesam4687 opened 7 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Google shows something similar:
The phone version gives domain error
@meesam4687 Can you describe when the input is incorrect? What numbers or mathematic rules are important here?
@meesam4687 Can you describe when the input is incorrect? What numbers or mathematic rules are important here?
tan(pi/2) radians is not defined
and any odd multiple of pi/2 rad is not defined either. Example tan(pi/2) is not defined tan(3pi/2) is not defined tan(5pi/2) is not defined and so on.
This is not an issue of PowerToys Run Calculator. It's relevant to the representation of floating number (because Pi is an infinite non-recurring decimal, and it can't be stored exactly).
That means, due to floating point precision, it's not possible to obtain the exact value Pi/2, so the result is always finite.
You can use Python and NodeJS to get the similar result.
>>> from math import tan, pi
>>> tan(pi/2)
1.633123935319537e+16
> Math.tan(Math.PI/2)
16331239353195370
You can find more details in links below:
@htcfreek Can we close this issue? Since the results are matching with Google's calc.
Edit: Also with Python and NodeJS.
@htcfreek Can we close this issue? Since the results are matching with Google's calc.
Edit: Also with Python and NodeJS.
@ethanfangg, thoughts?
Microsoft PowerToys version
0.80.1
Installation method
PowerToys auto-update
Running as admin
Yes
Area(s) with issue?
PowerToys Run
Steps to reproduce
Type tan(pi/2) in run
✔️ Expected Behavior
tan(pi/2) to not do anything like it does for other undefined values like it does to 5/0
❌ Actual Behavior
It gives tan(pi/2) as 16331239353195400
Other Software
No response