The problem with modulo on floats is, that due to rounding errors it often 
created weird results,
for instance in Python-3.8 this happens: 3.5 % 0.1 = 0.09999999999999981
This btw. also applies to the builtin divmod and math.fmod functions.
Therefore I proposed to do it via classic division and check if it's near 
enough to an integer value.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ce5717e1-db00-4c76-b98b-908a5202470bn%40googlegroups.com.
  • Re:... Jacob Rief
    • ... Josh Smeaton
      • ... Carlton Gibson
        • ... Jacob Rief
          • ... Carlton Gibson
            • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
            • ... Jacob Rief
            • ... Kapil Bansal
            • ... Jacob Rief
            • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
            • ... Jacob Rief
            • ... James Bennett
            • ... Kapil Bansal

Reply via email to