Method FModWrap
FModWrap(float, float)
FMod different from a % b in that it will return b + a % b if a is less than 0. Useful for indexing. Assuming a strictly positive b, returned value is always in [0, b).
Declaration
public static float FModWrap(float v, float m)
Parameters
Type | Name | Description |
---|---|---|
float | v | Quotient |
float | m | Divisor |
Returns
Type | Description |
---|---|
float | a % b if a >= 0 but b + a%b other wise |
FModWrap(double, double)
FMod different from a % b in that it will return b + a % b if a is less than 0. Useful for indexing. Assuming a strictly positive b, returned value is always in [0, b).
Declaration
public static double FModWrap(double v, double m)
Parameters
Type | Name | Description |
---|---|---|
double | v | Quotient |
double | m | Divisor |
Returns
Type | Description |
---|---|
double | a % b if a >= 0 but b + a%b other wise |