Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] More kinds of arithmetic operations #47

Open
tommens opened this issue Feb 9, 2022 · 0 comments
Open

[FEATURE] More kinds of arithmetic operations #47

tommens opened this issue Feb 9, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@tommens
Copy link
Owner

tommens commented Feb 9, 2022

Describe the new functionality you would like to see
The current calculator only provides support for +, *, / and -. Many other types of mathematical operations are needed. To get inspiration for other types of operations one can also look at what typical scientific calculator machines provide. Which types of operations to provide will depend on the types of numbers supported by the calculator.

  • For the real number domain, one needs to implement at least the following functions: logarithm (log and ln) and exponent, n-th root, and n-th power (x^^n), all trigonometric functions (sin, cos, tan; their inverses asin, acos, atan; their hyperbolic variants sinh, cosh, tang), the inverse function (1/x), and support for frequently used constants such as e and Pi.
  • For the integer number domain, it would be desirable to implement support for modular arithmetics.

Regardless of the considered number domain, it would be useful to implement a pseudorandom generator. For testing purposes, it should be possible to give a random seed to the random generator can be tested deterministically.

  • For the real number domain: No value needs to be provided as input, the random generator will always provide a real value between 0 and 1.
  • For the integer number domain: Given an integer as input, the random generator will provide a random integer between 0 and the integer provided as input.

Implementation recommendations
One could for example rely on java.lang.Math to implement other basic numeric operations, such as the power function, exponential, logarithm, square root, the trigonometric functions and more.

@tommens tommens added the enhancement New feature or request label Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant