PDA

View Full Version : I r stupid. Re: Javascript



bennator
08-30-2003, 04:52 AM
Most of my Javascript knowledge has faded away. Anyways, a need a square-root function for what I'm doing, and I have no clue if the language supports it. I've tried things like <i>Sqrt(a), root(a), </i>and <i>squareroot(a)</i> which haven't worked. For some reason I think Javascript doesn't have one. So, if anybody could:

A) Tell me the Javascript square-root algorithm if avalible

B) Point me to a place where I can download a written square-root function

C) Empower me with the math need to do square-roots only using *, /, +, - (and maybe %, does JS use that too?), so that I can write my own Square-Root function.

D) Tell me it's impossible, tell me to try it with a Java applet (requiring me to *get* the JDK which I have insufficent time to download, and I'm not willing to pay for it), a CGI script (God forbid, I'm not learning CGI), or some other program (although I'd like it to be able to be put on the web, I can survive if it's not possible).

any help would be appreciated.

Dr Unne
08-30-2003, 05:25 AM
http://tech.irt.org/articles/js069/#11

bennator
08-30-2003, 06:51 AM
Thanks Unne, I feel really stupid, I shoud have tried math.sqrt()

*hangs head in shame*

Dr Unne
08-30-2003, 03:45 PM
Spending 12 hours trying to fix a bug when the only thing wrong is one letter is one of the joys of programming.