Skip to content

Releases: mofosyne/QuickMathJS

v2.1.20

28 Oct 04:52
Compare
Choose a tag to compare

This releases has a few extra bugfixes

  • disable spellcheck in html input
  • add back in predefined currency notation
  • fix/improve custom unit handling
  • adjust : to only check the left hand side as it's always going to just be for output
    • But bit concerned what if this would cause problem later on to functions with '{param: value}' inside it like format()
  • html script only puts up alert if user did not calculation but only typed an expression without result

and other minor changes

v2.1.18

26 Oct 00:44
Compare
Choose a tag to compare

bugfix to fix unary minus handling


Updated syntax to support

  1. Currency Conversions : QuickMathJS allows for intuitive currency conversions using custom pair ratios. This can also be extended to other types of custom ratios.
  2. Unit Conversion and Mathematical Expressions : Leverage the power of Math.js to convert between units seamlessly and evaluate complex expressions.
  3. Custom Functions : Users can define custom functions and evaluate them with specific arguments. This allows for a reusable approach to complex calculations.
  4. 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.
  5. 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

v2.1.17

25 Oct 16:31
Compare
Choose a tag to compare

Updated syntax to support

  1. Currency Conversions : QuickMathJS allows for intuitive currency conversions using custom pair ratios. This can also be extended to other types of custom ratios.
  2. Unit Conversion and Mathematical Expressions : Leverage the power of Math.js to convert between units seamlessly and evaluate complex expressions.
  3. Custom Functions : Users can define custom functions and evaluate them with specific arguments. This allows for a reusable approach to complex calculations.
  4. 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.
  5. 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

V2.0.9

14 Oct 02:59
Compare
Choose a tag to compare

In this release we transitioned away from := into a more heuristics based = parsing.

This way the calc script looks more like this

a = 5
b = 7
c = a + b = 12
    = 12
1 + 1
    = 2
    c = 12

which is in my opinion more intuitive to understand and better reflect how maths may be written in email or paper.

Also made this more modular and published to npm so you can integrate this to other projects.

V1.1

09 Oct 13:18
Compare
Choose a tag to compare

Bugfix: Fix incorrect % symbol in mobile button

V1.0

09 Oct 13:00
Compare
Choose a tag to compare

Initial release of this miniproject.

Main thing is that this is actually an offline capable calculator. Just download and run it as there is a copy of mathjs as well in case you need to use it on the go from your laptop or something.