2023.11.1-3.3 • Published 2 years ago

xtfz v2023.11.1-3.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

NPM @ XTFZ

A multipurpose package and wrapper for XTFZ and you.

Configuration

To install the package run:

npm install xtfz

Import:

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 string
  • rad(degrees) - degrees to radians
  • deg(radians) - radians to degrees
  • pow(x, y) - x to the power y
  • root(x, y) - x root y
  • log(x, y) - log x base y
  • ln(x) - natural log x
  • fact(x) - x factorial (x!)
Comments
  • You can add comments in the evaluate(expression) function's expression string 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 expression parameter of evaluate(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

2 years ago

2023.3.1-8.2

2 years ago

2023.3.18

2 years ago