B
B
BotTimofey2020-05-14 22:42:21
PHP
BotTimofey, 2020-05-14 22:42:21

How to solve linear equations with one unknown in php?

Hello! I am making a math bot and decided to add an equation solving function to it. I started with linear equations with one unknown (example: 23-x+58/2=8+x*3). However, the whole Internet break, I did not find a single clue on how to do this - basically there are materials about solving quadratic equations. Although there are many sites with automatic solution of equations. Tell me how to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
John Didact, 2020-05-15
@BotTimofey

When I did something like this, I used an algebra textbook and studied formulas, then I transferred these formulas to PHP (not stupidly copy-paste) and everything worked. Only then I realized that I didn’t need it)) There were a lot of regular expressions and cycles in complex equations, many users would strain the server, I think. Moreover, there are a lot of similar servers, I don’t think that it would be in demand.
But it's up to you, use regular expressions and formulas

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question