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


Click here to return to the 'Yes it is a trivial fix' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Yes it is a trivial fix
Authored by: mcroft on May 25, '05 01:05:04PM
Yes, it's a trivial fix.

I wrote this after work last night. Here you go. It works both ways and has a persistant preference to let you pick which you want.

The reason it's a trivial fix is the same reason that pasting "1+2*3" calculates properly. The basic resolver is eval(display). As long as you build a string, it can resolve it.

[ Reply to This | # ]

Yes it is a trivial fix
Authored by: Gerk on May 25, '05 04:31:38PM

"Trivial fix" and "Easy Fix" are 2 different things ... it was an "easy fix" because you did it correctly by keeping a running tally of the equation. I don't consider a 400 line diff trivial considering it was a 540 line javascript to start with ;) hehe .. it's all relative!



[ Reply to This | # ]
OK, it's an easy fix
Authored by: mcroft on May 25, '05 05:05:20PM

Yeah, well. Calculator.js was as small as it was before because it didn't have an info button and backside and those require a lot of new functions to be copied and pasted from the documentation.

Anyway, the processing is easier than the processing that's being done to provide immediate evaluation.

The sub/add/mult/div functions are way too repetitive, as well. If I find any reason to touch it again, I'll fix that.



[ Reply to This | # ]