PDA

View Full Version : Math.sqrt()


chrismiceli
09-22-2002, 05:54 PM
I have this calculator program but when I click on the button to square root it takes two clicks to get it to work, and I can't do a simple function like this.
25*2/2 sqrt, because of the weird update string funtion. I can't type the numbers in the text feilds or it becomes undefined. Help here is a url to the program
http://www.geocities.com/rockanthology/calc.html

ConfusedOfLife
09-22-2002, 07:03 PM
Well, I don't think that you can ever write 25 * 2/2 and it answers, because it's not something that I call a calculator, anyway, for getting rid of two clicks, replace the squareroot() function of the original program with this one ( I hope he/she forgives me! ) :


function squareroot() {
document.Calculator.Input.value = inputString;
inputString = Math.sqrt(document.Calculator.Input.value);
document.Calculator.Input.value = inputString;
}



PS. If you really need a calculator, I have written one in flash, email me if you wana have it!