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

Add support of rational number to trigonometric functions #697

Open
sys27 opened this issue Aug 27, 2023 · 0 comments
Open

Add support of rational number to trigonometric functions #697

sys27 opened this issue Aug 27, 2023 · 0 comments
Assignees
Labels
feature proposal Features that are not approved yet
Milestone

Comments

@sys27
Copy link
Owner

sys27 commented Aug 27, 2023

Currently, the rational number is implemented in the following way: it has two NumberValues (numerator and denominator) and can represent only "numerical" rational values, like: 1 // 3. It provides basic abilities to work with rational numbers (+, -, *, /, ^, log) while keeping higher precision compared with irrational numbers, 1 // 3 vs 0.33333....

I think it could be helpful in trigonometric/hyperbolic functions:

sin(2pi // 3) = sqrt(3) // 2

So, the user can use variables and other functions inside rational numbers. For example, instead of using 2.0943951023931953 radians in the sine function, you will be able to write 2pi // 3 and it will be evaluated into the rational number sqrt(3) // 2 instead of 0.8660254037844386.

Questions:

  • How to represent the rational number? Should RationalValue store two references to IExpression? Or should we use the Rational class directly and remove RationalValue?
  • Do we need to add symbolic evaluation, like 3 * (sqrt(2) // 2) -> 3*sqrt(2) // 2?
  • If so, when do we need to use symbolic evaluation and when numeric (2 * (1 // 3) -> 2 // 3)?
  • Will it be helpful for The equation solving. #39?
@sys27 sys27 added feature proposal Features that are not approved yet labels Aug 27, 2023
@sys27 sys27 added this to the Backlog milestone Aug 27, 2023
@sys27 sys27 self-assigned this Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature proposal Features that are not approved yet
Projects
None yet
Development

No branches or pull requests

1 participant