Here you can find the source of mod(final float a, final float mod)
Parameter | Description |
---|---|
a | a parameter |
mod | a parameter |
final static public float mod(final float a, final float mod)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w. j a v a 2 s. c o m*/ * An equivalent to % for float * * @param a * @param mod * @return 0 <= b < mod */ final static public float mod(final float a, final float mod) { final float b = a - mod * (int) (a / mod); if (b >= 0) return b; else return b + mod; } }