Well I got to work on it, and it does have one BEDMAS problem.
Since the algorythm splits formulas into 2 sections, and then splits the right section of the formula again into 2 sections, and keeps on repeating until no sections are left, what happens is it messes up subtraction and addition.
For example, a string like "5 - 1 + 5" should work out to 9 using BEDMAS, but what the algorythm seems to be doing is:
Code:convert(5 - 1 + 5) split into "5" and "1 + 5" a = convert("5") returns 5 b = convert("1 + 5") split into "1" and "5" a = convert("1") returns 1 b = convert("5") returns 5 returns (a + b) which is 6 returns (a - b) which is -1




Reply With Quote