Welcome to the forum . If you don't mind me asking, what did you get in your A-Level Maths, and what parts did you find the hardest?

Now, on topic. Just skimming through the JavaScript I can see it's kind of messy. For example:

Code:

if (val == "sqrt" || val == "sin" || val == "sin-1" || val == "cos" || val == "cos-1" || val == "tan" || val == "tan-1" || val == "log" || val == "ln") {
if ((type[count-1] == 0 && count > 0) || (count == 0)) {
if (val == "sqrt") {
mode = 6;
} else if (val == "sin") {
mode = 7;
} else if (val == "sin-1") {
mode = 8;
} else if (val == "cos") {
mode = 9;
} else if (val == "cos-1") {
mode = 10;
} else if (val == "tan") {
mode = 11;
} else if (val == "tan-1") {
mode = 12;
} else if (val == "log") {
mode = 13;
} else if (val == "ln") {
mode = 14;
}
} else {
err = 2;
}
}

That can easily be achieved using the switch statement . Or of course, if you really want to be extravagant rewrite the whole inner if statement using ternary xD . It would be a lot shorter, but probably not as efficient.