Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
toString(precision) {
return `f(x) = ${maybeToPrecision(this.A, precision)} * x^${this.M}`;
}
toLaTeX(precision) {
if (this.M >= 0) {
return (
`f(x) = ${maybeToPrecision(this.A, precision)}x^{${this.M}}`
);
} else {
return (
`f(x) = \\frac{${
maybeToPrecision(this.A, precision)
}}{x^{${
-this.M
}}}`
);
}
}