Java Double Number Round roundDown(long n, long m)

Here you can find the source of roundDown(long n, long m)

Description

Round n down to nearest multiple of m.

License

Open Source License

Parameter

Parameter Description
n the number to round
m the number to round to.

Return

the result of the calculation

Declaration

static int roundDown(long n, long m) 

Method Source Code

//package com.java2s;
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

public class Main {
    /**//  w w w .j a v a 2 s  .  c  om
     * Round n down to nearest multiple of m.
     *
     * @param n the number to round
     * @param m the number to round to.
     * @return the result of the calculation
     */
    static int roundDown(long n, long m) {
        return (int) ((n / m) * m);
    }
}

Related

  1. RoundDown(final T number)
  2. roundDown(int n, int m)
  3. roundDown(int number, int mod)
  4. roundDown(int val, int shift)
  5. roundDown(int val, int to)
  6. roundDown(long size, long roundBoundary)
  7. roundDown(long val, long delta)
  8. roundDownTo(int a, int quanta)
  9. roundDownToNearest(double number, double nearest)