Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Java programming help
#1
is there a command for calculating the square root of a number? if so, what is it?

I'm new to the java language and so far we've only learned basic operation and if and switch. but for this program i have to write for hwk, I have to use square root.
Reply
#2
Math.sqrt(double d) or Math.pow(double d, 0.5) (I've not checked what's faster, actually. Something I should do)
Math-class. (Static, don't initialize it)

Use the Java API next time you need to look up something.
Reply
#3
TYVM!!!!

now i can finally finish my hwk
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)