18 public static bool IsMultipleOf(
this float v,
float n,
float tolerance = 0.001f)
20 return Math.Abs(v % n) < tolerance;
28 public static bool IsMultipleOf(
this float v,
int n,
float tolerance = 0.001f)
30 return Math.Abs(Math.Abs(v % n)) < tolerance;
47 public static bool IsMultipleOf(
this int v,
float n,
float tolerance = 0.001f)
49 return Math.Abs(Math.Abs(v % n)) < tolerance;
Extensions for the Mathf class
static bool IsMultipleOf(this float v, float n, float tolerance=0.001f)
Calculates if the float is multiple of another float.
static bool IsMultipleOf(this int v, float n, float tolerance=0.001f)
Calculates if the int is multiple of a float.
static bool IsMultipleOf(this int v, int n)
Calculates if the int is multiple of another int.
static bool IsMultipleOf(this float v, int n, float tolerance=0.001f)
Calculates if the float is multiple of an int.