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] Supporting rational numbers #46

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

[FEATURE] Supporting rational numbers #46

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
It would be useful to have primitive built-in support for rational numbers in the calculator (e.g. 3/4, 12/7, ...). A rational number can be seen as a fraction of two integer numbers.
https://en.wikipedia.org/wiki/Rational_number

Is your feature request related to a specific need or problem?
The idea of this extension is NOT to consider such fractions as decimal floating point numbers (e.g. 0.75 instead of 3/4) as this will lead to a loss of precision (e.g. 1/3 = 0.333333... but it is not possible to represent an infinite sequence of numbers in the decimal notation).
So we need arithmetic operations that work directly over rational numbers to avoid such loss of precision.

Additional context
(Some languages, such as Scheme provide built-in support for rational numbers.)

@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