I built an order of arithmetic operations algorithm and i want to ask something before I am writing this algorithm in the compiler:

How can i be sure that my algorithm works in every case,

in a trivial cases and also in very complicated cases like brackets in bracket in brackets+brackets............

thanking you in advance