The problem you are seeing is because Blender's gray scale is $[0..1]$ and Blender clamps values < 0 to 0 and values > 1 to 1. So all of your negative values come out as black. If you had values > 1 they would all come out as white.
While you can use other approaches, an efficient approach to solving this problem is to use the Map Range node to map your input values into a positive range:

Here I've used a Texture Coordinate node to generate the range $[-1..1]$ and a Map Range node to the resulting range $[0..20]. This will give you 10 iterations through the modulo operator set to 2, or 20 set to 1.
fmodffunction, which has this behavior. See Modulo operation. – scurest Aug 07 '22 at 00:23