Mathjs with number as Fraction and function equals #2915
Unanswered
maverick56
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Apparently the method I'll turn this discussion into an issue. It sounds like this is a solvable bug. Anyone able to look into this? Help would be welcome. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I parameterize the mathjs like this :
const config: math.ConfigOptions = { number: "Fraction", }; const math: MathJsStatic = create(all, config);
I create units like this :
math.createUnit('rotation', {definition: '360 deg', aliases: ['tour','tr']})
I try to do this :
const a = math.unit(360, "deg"); const b = math.unit(1, "rotation"); expect(b.equals(a));
And i have this error :
TypeError: Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: 6.283185307179586). Use function fraction(x) to convert to Fraction.
Any idee ??!
tks.
Beta Was this translation helpful? Give feedback.
All reactions