Basic Calculator with GUI I recently had to add a small basic calculator to a project. I wrote a quick dirty one, but it seemed small enough to check with you people out here ;)

Just out of curiosity &amp; an appetite to get surprised for some real hacky solutions, try and beat this one : 

CODE (JS/JQUERY):

function scalcy() {
    var b="", p=parseFloat,t,i;
    return $("&lt;div&gt;").append("789/456*123-.0=+".split("").map(function(i){
        return $("&lt;button/&gt;").text(i).width(32).height(32).click(function(){
        b = (!p(i=$(this).text())? b.replace(/\D+$/,""): b) + i;        
        t.val(((!(i.match(/[.\d]/))? (b=eval(b.slice(0,-1))+i+"").slice(0,-1):
                p(b.match(/[.\d]+/g).pop()) || 0) + "").slice(0,8));
    })})).prepend(t=$("&lt;input/&gt;").width(123).click(function(){
        this.value=b="0";})).width(130);
}


Screenshot (in chrome): (DEMO)



Considerations: Better the UI &amp; lesser the bugs, the better.

Minimum Functionalities: 


Supports floating point arithmetic (/*-+),
Reset feature,
Continuous Operation (like working on with the last result) 


Note:


Use any language &amp; library, but please not a library call like new
calculator().
Forking the above code itself is most welcome.




Additional Notes:


A graphical UI is obviously considered better than not having any at all.
I'd suggest to have a look at this challenge (for inspiration): Create a GUI Piano.
Tcl/Tk, 100

pack [entry .e -textv e] -f both -e 1
bind . &lt;Return&gt; {catch {expr $e} e}
bind . &lt;Escape&gt; {set e {}}


Buttons are not required, so leave them alone.
The GUI is great. So simple that you can finally focus on the task that you try to do.