one-variable-linear-equatio.../README.md

26 lines
625 B
Markdown
Raw Normal View History

2018-05-21 02:04:23 +08:00
# one-variable-linear-equation-solver
A program to solve one-variable linear equation. It's written in C with flex and bison.
Dependencies
---------------
* flex >= 2.6.0
* bison >= 3.0.0
* make >= 4.1
* gcc >= 5.4.0
Compile
----------
2018-05-21 02:07:52 +08:00
Type ``make`` after entering the folder of the repo.
2018-05-21 02:04:23 +08:00
Execute
----------
2018-05-21 02:07:52 +08:00
Execute it with the command:
2018-05-21 02:04:23 +08:00
``./interp``
2018-05-21 02:07:52 +08:00
After showing the introdution, type the formula (eg. ``2*x+5``), then press enter to solve it. For example:
2018-05-21 02:04:23 +08:00
A program to solve f(x) = 0 such that f(x) is a 1-var linear function.
2018-05-21 12:23:30 +08:00
Please enter a 1-var linear function: 2*x+5
2018-05-21 02:04:23 +08:00
ANSWER: x = -2.500000