@sburkebuzz That makes sense! It's doing the entire equation in PEMDAS order instead of taking the previous total - 5×5+1-(4×99) instead of (5×5+1-4)×99. Thanks for the catch!

0/0 collapses it :) you should catch the infinity value and replace it with 0 something like if output == Infinity || isNaN(output)) { output = "error"; // or output = 0 }

Leave a CommentMarkdown supported.
Click @usernames to add to comment.

Thanks for citing ;)

This doesn't work! (but it looks nice)

@sburkebuzz Thanks! Which part isn't working? It seems to be working from my end!

@supah Of course~

5X5 enter (25)

+1 enter (26)

-4 enter (22)

x 99 enter (-370) ??

Just a bug :)

@sburkebuzz That makes sense! It's doing the entire equation in PEMDAS order instead of taking the previous total -

`5×5+1-(4×99)`

instead of`(5×5+1-4)×99`

. Thanks for the catch!0/0 collapses it :) you should catch the infinity value and replace it with 0 something like

`if output == Infinity || isNaN(output)) {`

`output = "error"; // or output = 0`

`}`