Skip to content
This repository has been archived by the owner on Jan 16, 2019. It is now read-only.

bfontaine/FormulaJS

Repository files navigation

FormulaJS

This is an interpreter for basic formulas, based on an original idea by @tsalmon.

Note: this is an old, unmaintained project.

Usage

formula <file>
formula <formula>

Features

  • Floats & integers, negative and positive numbers
  • basic operations (+, -, /, *) and power (^)
  • constants (E, PI)
  • some syntaxic sugar (e.g. (…)(…) instead of (…)*(…)), various alternatives for some operations (e.g. or × instead of *, ÷ instead of /).

Examples

formula -2+3                 # 1
formula "((42-5)(12*3+2))^3" # 2779431416
formula PI*1.5               # 4.71238898038469

About

Basic formulas interpreter

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published