Here you can find the source of round(double val)
Our own implementation of Math.round due to difference between java 1.6 and 1.7 implementations See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6430675">Java bug 6430675</a> Using java 1.6 implementation of Math.round defined as floor of 0.5d plus value.
Parameter | Description |
---|---|
val | value to round |
public static long round(double val)
//package com.java2s; public class Main { /**//from w ww . j av a2 s . com * Our own implementation of Math.round due to difference between java 1.6 and 1.7 implementations * See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6430675">Java bug 6430675</a> * * Using java 1.6 implementation of Math.round * defined as floor of 0.5d plus value. * @param val value to round * @return rounded value */ public static long round(double val) { return (long) Math.floor(val + 0.5d); } }