fork(3) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. test1();
  8. }
  9.  
  10. public static void test1()
  11. {
  12. int stepAmount = 100;
  13. float t = 0.02f;
  14. float remainder = t % (1f / stepAmount);
  15. Console.WriteLine("Remainder: " + remainder);
  16. // Remainder: 0.01
  17.  
  18. float fractions = 1f / stepAmount;
  19. remainder = t % fractions;
  20. Console.WriteLine("Remainder: " + remainder);
  21. // Remainder: 0
  22. }
  23. }
Success #stdin #stdout 0s 131648KB
stdin
Standard input is empty
stdout
Remainder: 0.01
Remainder: 0