Support calculate ^0.5

This commit is contained in:
2025-09-14 13:42:14 +08:00
parent c9190d05a1
commit e6a52b8b74
4 changed files with 149 additions and 16 deletions

View File

@@ -39,7 +39,7 @@ void main() {
test('非完全平方数', () {
var expr = Parser("sqrt(8)").parse();
expect(expr.simplify().toString().replaceAll(' ', ''), "(2*sqrt(2))");
expect(expr.simplify().toString().replaceAll(' ', ''), "(2*\\sqrt{2})");
});
});
@@ -53,7 +53,7 @@ void main() {
var expr = Parser("sqrt(8)/4 + 1/2").parse();
expect(
expr.evaluate().toString().replaceAll(' ', ''),
"((sqrt(2)/2)+1/2)",
"((\\sqrt{2}/2)+1/2)",
);
});
});