microsoft / calculator

Windows Calculator: A simple yet powerful calculator that ships with Windows
MIT License
29.53k stars 5.35k forks source link

Add support for imaginary numbers #613

Open grochocki opened 5 years ago

grochocki commented 5 years ago

Problem Statement Windows Calculator currently does not support imaginary numbers. Instead, we show "Invalid input":

image

Evidence or User Insights The complex number system is part of US high school common core curriculum. According to some reports in the Math Educators Stack Exchange, complex numbers are taught in at least some high school level math and science courses in China, Norway, Italy, India, Israel, and the UK.

Proposal Add support for imaginary numbers in Scientific mode of Windows Calculator.

Goals

Non-Goals

Low-Fidelity Concept image

Requested Assignment I'm just suggesting this idea. I don't want to implement it.

ghost commented 5 years ago

This pitch looks like it has everything it needs for review. In the meantime, we'll keep this idea open for discussion so the community has the chance to provide feedback. Check out our New Feedback Process for more info on the user-centered process we follow for new feature development.

MicrosoftIssueBot commented 5 years ago

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

rudyhuyn commented 5 years ago

Great suggestion! It's also taught in France in the final year of high school.

This feature (not supported by the other first party calculators to my knowledge) will be a great addition for students and scientists!

ghost commented 5 years ago

We reviewed the pitch and would love to explore this idea further! The pitch is a great start, but there are still some open questions. I am moving this issue into planning to iron out some of those details and I created calculator-specs/imaginaryNumbers to track progress. A human will follow up with some feedback on your pitch shortly. Keep in mind that not all ideas that make it into the planning phase are guaranteed to make it to release. For more information on next steps, check out our spec workflow.

dovisutu commented 4 years ago

There's a little problem with z^w where z and w are all Complex number, because it depends on ln(z) which (sadly) has more than 1 value in Complex. The solution is (possibly) make a logarithm-branch-selector allows to use different branches of ln() (aka limits the results' im part in a range with width 2π). Or we can simply limit inside the branch -π<=im(ln(z))<=π.

Firestar-Reimu commented 2 years ago

Although this is a C++/C# software, you can reference numpy which is very related to C.

Numpy for python supports log for complex:

import numpy
a = 114+514j
numpy.log(a) = (6.266232842926283+1.3525394122120178j)