2:05 am - Tuesday April 23, 2019

Math Example Program for rint(double a)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**
@AUTHOR: candid java.com
@DESCRIPTION: coding for  get  the double value  closest to specified value and equal to an integer
*/

public class Rint
{
 public static void main(String[] args)
  {
 // TODO Auto-generated method stub
 double d=45.7889;
 System.out.println("double value:"+Math.rint(d));//Returns double value         //closest to d and equal to an integer
  }
}


OUTPUT

double value:46.0

Filed in: Z-A All Java Codes

Comments are closed.