Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Implementing PEMDAS' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Implementing PEMDAS
Authored by: mcroft on May 24, '05 08:29:14PM

Not really, all you're doing is building a string to send to the JavaScript eval() function. The engine handles PEMDAS just fine and since there aren't buttons for P and E, it's limited right now to the rather simple MDAS.

I've got it working for addition right now. I need to make it smart enough to not add a second operator if the last item is already an operator. Once it's working, I need to add a preference [Delayed Execution/Immediate Execution], a flip to the backside button and a backside, and then let some of you test it.

[ Reply to This | # ]
Implementing PEMDAS
Authored by: mcroft on May 24, '05 10:06:31PM

I've got the JavaScript done for a drop-in replacement if anyone wants it. I'll start messing with a polished implementation with a setting on the back et. al., but I've done a lot more JavaScript than I have widget work, so I don't know when it will be done.

powers are more difficult, but not out of the question (eval won't handle them intrinsically).

email me and I'll send you the modified calculator.js.

It's also pretty clear how you'd use this for RPN

[ Reply to This | # ]
Implementing PEMDAS
Authored by: mcroft on May 25, '05 01:15:48AM
Option Enabled MDAS awareCalculator Widget variant.

[ Reply to This | # ]