Java Math help please


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Java Math help please

  1. #1
    Join Date
    Jul 2014
    Posts
    9

    Java Math help please

    The area of a square is stored in a double variable named area . Write an expression whose value is length of the diagonal of the square.
    Do I use math.sqrt?

  2. #2
    Join Date
    Aug 2014
    Posts
    5
    I am also same problem. Please anyone help me about Java Math. I need to learn about it. Thanks

  3. #3
    Join Date
    Jul 2014
    Posts
    9
    You can read the next article azillionmonkeys[dot]com/qed/sqroot[dot]html

  4. #4
    Join Date
    Aug 2014
    Posts
    1
    Quote Originally Posted by Anglin View Post
    I am also same problem. Please anyone help me about Java Math. I need to learn about it. Thanks
    Because you stated "a square", you will use the Pythagorean theorem. The diagonal of the square if the hypotenuse of a triangle whose two sides are the sides of your square. The Pythagorean theorem states that the square of the hypotenuse of a triangle is equal to the sum of the squares of the other two sides.
    Therefore, one version of the calculation would be:

    hypotenuse = Math.sqrt(side1 * side1 + side2 *side2);

  5. #5
    Join Date
    Jul 2014
    Posts
    9
    Java - Math class for only simple task. Please advise me stronger any math class.

Similar Threads

  1. C++ math to VB
    By Fmetal in forum C++
    Replies: 1
    Last Post: 07-23-2005, 01:32 AM
  2. limits on java math
    By Corbin in forum Java
    Replies: 1
    Last Post: 02-06-2001, 11:01 AM
  3. limits on java math
    By Corbin in forum Java
    Replies: 0
    Last Post: 02-05-2001, 10:40 PM
  4. Math
    By Joka in forum C++
    Replies: 1
    Last Post: 02-02-2001, 04:48 PM
  5. Small Java Code for Math
    By Nancy in forum Java
    Replies: 2
    Last Post: 09-14-2000, 09:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center