Java Double Number Round round(double x)

Here you can find the source of round(double x)

Description

Data un valore decimale ritorna un intero che lo arrotondato

License

Open Source License

Parameter

Parameter Description
x Valore decimale

Return

Restituisce l'intero che lo arrotonda

Declaration


static int round(double x) 

Method Source Code

//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);
    }
}

Related

  1. round(double valueToTruncate, int requiredDecimalPlaces)
  2. round(double what, int howmuch)
  3. round(double x)
  4. round(double x)
  5. round(double x)
  6. round(double x, int numPlaces)
  7. round(double x, int places)
  8. round(double zahl, int stellen)
  9. round(double[] arr)