You can manually check whether the difference between the outcome and the modulus of the operation is smaller than a set epsilon (representing a very small number), and set it to zero.

For example:

float result = a % b; // 1.570796
float epsilon = 0.0001f;
result = Mathf.Abs(result - b) < epsilon ? 0f : result; // 0

Or you can create a custom method:

public static float Modulo(float a, float b, float epsilon)
{
return Mathf.Abs(a % b - b) < epsilon ? 0 : a % b;
}