Here you can find the source of round(double x)
Parameter | Description |
---|---|
x | Valore decimale |
static int round(double x)
//package com.java2s; /****************************************************************************** * Copyright (c) 2015 Nicola Mometto/* ww w .ja v a 2 s.c om*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Nicola Mometto * Antonio Cavestro * Sebastiano Valle * Gabriele Pozzan ******************************************************************************/ public class Main { /** * Data un valore decimale ritorna un intero che lo arrotondato * * @param x Valore decimale * @return Restituisce l'intero che lo arrotonda */ static int round(double x) { return (int) Math.round(x); } }