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
The documentation on https://mathjs.org/docs/datatypes/fractions.html states that "[m]ost functions will determine the type of output from the type of input: [...], a Fraction as input returns a Fraction as output".
I specifically cannot get this to work for fractions. For me, every function that takes only Fraction parameters returns an object of type MathType. This object cannot be stored in a Fraction object without an explicit cast (one per function call) and it cannot be returned by a function that has return type Fraction.
Could the documentation be wrong here? It is required to do an explicit cast after every function call involving fractions?
The text was updated successfully, but these errors were encountered:
wouterbeek
changed the title
Unclear documentation for calling functions with rations
Unclear documentation for calling functions with fractions
Aug 10, 2022
The documentation on https://mathjs.org/docs/datatypes/fractions.html states that "[m]ost functions will determine the type of output from the type of input: [...], a Fraction as input returns a Fraction as output".
I specifically cannot get this to work for fractions. For me, every function that takes only
Fraction
parameters returns an object of typeMathType
. This object cannot be stored in aFraction
object without an explicit cast (one per function call) and it cannot be returned by a function that has return typeFraction
.Could the documentation be wrong here? It is required to do an explicit cast after every function call involving fractions?
Here is my example code:
The text was updated successfully, but these errors were encountered: