Here you can find the source of round(double a)
Parameter | Description |
---|---|
a | double to be rounded |
public static double round(double a)
//package com.java2s; public class Main { /** Returns a double rounded to the nearest integer. * @param a double to be rounded/* ww w .j av a2 s . c o m*/ * @return double containing the rounded number. */ public static double round(double a) { return Math.floor(a + 0.5); } }