If you click a submit button, the associated form will be submitted. This is the default behaviour of the click event. The same applies to onsubmit for the form itself.
To prevent the default behaviour you will have to take measures like "return false" from the event handler.
Code:
<input type="submit" value="submit" name="submit" id="submit" onclick="calculator(); return false;" />
On top of this you should not return a value from the calculator function. So just remove the "return" from document.write in the last statement