Skip to content

ParamVarunReddy/Arithmetic-Formula

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arithmetic-Formula

We introduce FormulaArithmetic, a lightweight JavaScript library that enables dynamic, client-side evaluation of complex arithmetic expressions in web applications. Unlike native eval() approaches, FormulaArithmetic safely parses and executes formulas containing both standard operators ( +, -, *, /, %, ^ ) and Excel-style functions (ADD, SUBTRACT, MULTIPLY, DIVIDE, MOD, POWER), including nested and variadic calls. Its architecture combines an iterative function-expansion preprocessor, a linear-time tokenizer, Dijkstra’s Shunting-Yard algorithm for operator precedence (BODMAS/PEMDAS), and a stack-based RPN evaluator—yielding robust performance (O(F·L) worst-case for F nested functions over an expression of length L) without external dependencies. FormulaArithmetic integrates seamlessly as a standalone web resource or ES module, empowering form designers to deliver spreadsheet-like formula capabilities directly within the browser.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published