fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. const double m = 0.125;
  8. var a = m;
  9. var count = 1;
  10.  
  11. while (a > 0)
  12. {
  13. var isZeroA = (a * m) == 0;
  14. var b = a * m;
  15. var isZeroB = b == 0;
  16. if (isZeroA != isZeroB) {
  17. Console.WriteLine("IsZeroA: {0}, IsZeroB: {1} Count:{2}", isZeroA, isZeroB, count);
  18. }
  19. a *= m;
  20. ++count;
  21. }
  22.  
  23. }
  24. }
Success #stdin #stdout 0.04s 23976KB
stdin
Standard input is empty
stdout
IsZeroA: False, IsZeroB: True Count:358