Java Number Round roundM(int n, int m)

Here you can find the source of roundM(int n, int m)

Description

round M

License

Open Source License

Declaration

public static int roundM(int n, int m) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int roundM(int n, int m) {
        return (int) (Math.floor((n + m - 1) / m) * m);
    }/*from  w  w w.  jav  a  2s  .  c o m*/

    public static int floor(double x) {
        return (int) Math.floor(x);
    }
}

Related

  1. roundingRightShift(int x, int count)
  2. roundIntegerToNearestUpperTenth(int a)
  3. roundInventorySize(final int size)
  4. roundJs(double v, int n)
  5. roundLong(double a)
  6. roundMinAndMax(double min, double max, int tickCount)
  7. roundMultiplier(double n)
  8. roundNearest(double v, double target)
  9. roundNicely(double dbl)