You can check out the script here: ubiquity_gcalc.js. If you have Ubiquity installed, you should see a Subscribe button in the upper right; alternatively you can get the javascript code from the above link, paste it into your Ubiquity command-editor, and edit away.
To use the calculator, invoke Ubiquity (Ctrl-Space) and type gcalc followed by any mathematical expression. The result appears immediately, you don't need to hit Enter. Alternatively, highlight a mathematical expression with the mouse and then invoke Ubiquity and gcalc.
Also check out my other Ubiquity scripts. They are all in the public domain; you can use them in any way you like.