josdejong/mathjs

simplify `sqrt(x)*sqrt(x)`

Open

#3,231 建立於 2024年7月10日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)JavaScript (13,832 star) (1,298 fork)batch import
featurehelp wanted

描述

I asked it to simplify sqrt(x)*sqrt(x) and it couldn't do it. Nor could it do really anything with sqrt. As soon as I added the following single rule, it works perfectly and does all the things you would hope it should know how to do!

const simpRules = [...(math.simplify.rules)];
simpRules.push('sqrt(n1) -> n1^0.5');
math.simplify(exp,simpRules);

I suggest adding 'sqrt(n1) -> n1^0.5' to simplify.js

貢獻者指南