-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
When I multiply two quantities, I would expect that any unambiguous cancellations of derived units would be applied automatically, however this example using mathjs@7.2.0 returns "(J m) / (m s)" instead of the expected "J / s":
{
let a=math.unit(1, 'J/m');
let b=math.unit(1, 'm/s');
return math.multiply(a,b).toJSON().unit;
}
If there are performance reasons to defer this type of automatic simplification, perhaps a method to manually trigger would be useful (and apologies if it already exists and I missed it). The toSI method is not what I am looking for since it returns "(kg m^2) / s^3" which is less useful than "J / s" in many contexts.
I noticed the skipAutomaticSimplification attribute, but setting this false on a and b before multiplying does not change the result.
Reactions are currently unavailable