Ceiling() public static method

public static Ceiling ( float v ) : float
v float
return float
Esempio n. 1
0
 /**
  * Rounds a value to the nearest multiple of a target.
  */
 public static float RoundNearest(float v, float target)
 {
     target = Math.Abs(target);
     if (v >= 0)
     {
         return(target * FloatMath.Floor((v + 0.5f * target) / target));
     }
     else
     {
         return(target * FloatMath.Ceiling((v - 0.5f * target) / target));
     }
 }