Skip to content

About

Enterprise calculation engine - bc-style calculator: rationals, complex numbers, matrices, functions

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

computorv2

An interactive bc-style calculator with rationals, complex numbers, matrices, user-defined functions and degree-2 equation solving. All numeric types are written from scratch: no native complex, no external library. A 42 Abu Dhabi project.

Run

python3 computorv2.py

Then type expressions. exit, quit or EOF ends the session.

Test

python3 test_computorv2.py

Notes

  • Supports + - * / %, integer power ^, matrix multiplication ** against term-to-term *, parentheses, unary minus and implicit multiplication (4x, 2i, 2(...)).
  • Known gap: function display constant-folds but does not combine like terms across a symbolic term, so funC(x) = 4x + 5 - 2 prints as written rather than 4 * x + 3. Numeric evaluation is exact; only the printed form differs.
  • Matrix power via ^ is not implemented.
  • PROGRESS.md is the development log.

TODO

  • Function display only constant-folds. Collect the body as a polynomial form before printing, so funC(x) = 4x + 5 - 2 shows as 4 * x + 3.
  • Implement matrix power via ^.
  • Support = ? to echo a stored variable or function.

About

Enterprise calculation engine - bc-style calculator: rationals, complex numbers, matrices, functions

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages