Here you can find the source of clampWithMod(float parFloat, float parMax)
public static float clampWithMod(float parFloat, float parMax)
//package com.java2s; //License from project: Apache License public class Main { public static float clampWithMod(float parFloat, float parMax) { return (parFloat + parMax) % parMax; }//from www.j a v a 2s.co m }