• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Math class

 
rohith das
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai Friends,


Can you please tell me how to use java.math class

for example how to use sin() function .
can you please provide me an example.

thanks in advance ,
rohith
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Math class is a class that provides static utility functions for mathematical operations, such as round, floor, ceil etc.

To use it, you don't need an instance, since all methods are static.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.out.println("sin 123 = " + Math.sin(123));

Beware: make sure to go through the documentation for the methods and check the units required.
 
rohith das
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both Sebastian Janisch, Campbell Ritchie it helped me.


rohith

 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic