I'm making a simple calculator, programmed in a java-applet (not javascript, regular java).
I want to make a button that does the squareroot of whatever is in the display and returns it immediately, or
maybe does the cosine of a value in the display and returns it likewise.
When I tro do this it says that I need a double in order to do this, and my display is a
TextField, where I retrieve the value in it by calling displayInOut.getText() - how do I do the square-root
for instance (+Math.sqrt) of what ever is in the display when the user presses the sqrt-button?
hope to hear from you...
I want to make a button that does the squareroot of whatever is in the display and returns it immediately, or
maybe does the cosine of a value in the display and returns it likewise.
When I tro do this it says that I need a double in order to do this, and my display is a
TextField, where I retrieve the value in it by calling displayInOut.getText() - how do I do the square-root
for instance (+Math.sqrt) of what ever is in the display when the user presses the sqrt-button?
hope to hear from you...