v2.1.18
bugfix to fix unary minus handling
Updated syntax to support
- Currency Conversions : QuickMathJS allows for intuitive currency conversions using custom pair ratios. This can also be extended to other types of custom ratios.
- Unit Conversion and Mathematical Expressions : Leverage the power of Math.js to convert between units seamlessly and evaluate complex expressions.
- Custom Functions : Users can define custom functions and evaluate them with specific arguments. This allows for a reusable approach to complex calculations.
- Phrases as Variables : Beyond traditional variable names, QuickMathJS supports using sentences as variable names. Just ensure they don't conflict with reserved keywords in Math.js.
- Custom Units and Compound Calculations : Define your own custom units and perform arithmetic operations with them, even allowing for compound calculations.
# Custom Pair Ratios (e.g. Currency Conversion and Arithmetic with Defined Exchange Rate)
EUR/USD = 1.2
a = 2 USD
b = 2.4 EUR
c = a + 2 * b = 6 USD
a + b in EUR : 4.8 EUR
total = a + c
total in EUR: 9.6 EUR
# Unit Conversion with Math.js
length = 5.08 cm + 2 inch = 10.16 cm
length in cm to inch = 4 inch
# Evaluating Mathematical Expressions
1.2 / (3.3 + 1.7) = 0.24
sin(90 deg) = 1
# Defining and Evaluating Custom Functions
f(x, y) = x ^ y
f(2, 3) = 8
# Phrase As Variabes
Per Person Delivery = 11
People Count = 23
Delivery = 12
Total Food Price = Per Person Delivery * People Count = 253
Total Price = Total Food Price + Delivery = 265
Total Price: 265
# Custom Units
pitbull dogs = 234 fancy animals
flowery cats = 423 fancy animals
animal count = pitbull dogs + flowery cats
animal count: 657 fancy animals
animal count = pitbull dogs * flowery cats
animal count: 98982 fancyanimals^2