You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)?
Currently, the rational number is implemented in the following way: it has two
NumberValue
s (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
vs0.33333...
.I think it could be helpful in trigonometric/hyperbolic functions:
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 write2pi // 3
and it will be evaluated into the rational numbersqrt(3) // 2
instead of0.8660254037844386
.Questions:
RationalValue
store two references toIExpression
? Or should we use theRational
class directly and removeRationalValue
?3 * (sqrt(2) // 2)
->3*sqrt(2) // 2
?2 * (1 // 3)
->2 // 3
)?The text was updated successfully, but these errors were encountered: