calculator-parser 1.0.1

A simple calculation parser for user input
Documentation
  • Coverage
  • 0%
    0 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 10.98 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.32 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • AsyncBanana

Calculator

A lightweight rust calculation parser. Only supports basic syntax, eg. no parentheses or functions beyond basic operators.

The current operators that are supported are

Character used Function
+ Add to number
- Subtract from number
* Multiply number
\ Divide number
^ Use an exponent

Example: 2^2+5 would be transformed into 9. It is pretty much just normal math syntax.

Just pass a string reference to the calculate function, and a 64 bit floating point number will be returned.