• Post Reply Bookmark Topic Watch Topic
  • New Topic

Use of abs() method  RSS feed

 
Anu satya
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I need to use abs() method on double variable.

Eg: double a = 1.25d
double b = abs(a);--> not sure how to use abs() method.

Can any one please help?
 
Joanne Neal
Rancher
Posts: 3742
16
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you are talking about the method in the Math class, you call it the same way as you call any other static method - using the class name.
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can import it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!