2023.11.1-3.3 • Published 2 years ago
xtfz v2023.11.1-3.3
NPM @ XTFZ
A multipurpose package and wrapper for XTFZ and you.
Configuration
To install the package run:
npm install xtfzImport:
const XTFZ = require("xtfz");Start Using!
We have numerous classes and functions: Calculator, ... (soon)
Calculator
const json = true; // do you want the response in JSON?
const calculator = new XTFZ.Calculator(json);
const result = calculator.evaluate("fact(2) * /*ignore*/ fact(2) / pow(fact(2), 2)");
console.log(result); // "1"Features:
Functions:
evaluate(expression)- evaluate the stringrad(degrees)- degrees to radiansdeg(radians)- radians to degreespow(x, y)-xto the poweryroot(x, y)-xrootylog(x, y)- logxbaseyln(x)- natural logxfact(x)-xfactorial (x!)
Comments
- You can add comments in the
evaluate(expression)function'sexpressionstring parameter. - It must be a single line comment:
/* like this */ - This can be used to document your expression
- It works because it uses the javascript
eval()method to evaluate. However, non-arithmetic tasks won't work.
Scientific
- We have other functions too, like trigonometric functions -
sin()cos()tan(). - Note: Trigonometric functions only work in the
expressionparameter ofevaluate(expression)function.
Made with 🍆 by @snehasishkun for XTFZ and You. 🛐
2023.11.1-3.3
2 years ago
1.0.0
2 years ago
2023.11.1-3.2
2 years ago
2023.11.1-3.1
2 years ago
2023.3.1-8.3
3 years ago
2023.3.1-8.2
3 years ago
2023.3.18
3 years ago