Here you can find the source of floor(double a, double precision)
Parameter | Description |
---|---|
a | Value |
precision | Precision |
public static double floor(double a, double precision)
//package com.java2s; //License from project: Open Source License public class Main { /**//ww w. j a v a 2 s . com * Returns a rounded number smaller than {@code a} with a defined * precision. * * @param a Value * @param precision Precision * @return Rounded value */ public static double floor(double a, double precision) { if (precision == 0.0) { return 0.0; } return Math.floor(a / precision) * precision; } }