Answer the question
In order to leave comments, you need to log in
Why does division result in zero in C#?
Hello, in the lines below, for some reason, the expression returns zero, it should be 0.0118
Console.WriteLine(Convert.ToInt64("11800000000000000") / Convert.ToInt64(1000000000000000000)); // 0
Console.WriteLine(Convert.ToUInt64("11800000000000000") / Convert.ToUInt64(1000000000000000000)); // 0
Console.WriteLine(Convert.ToInt64("11800000000000000") / 1000000000000000000); // 0
Console.WriteLine(Convert.ToUInt64("11800000000000000") / 1000000000000000000); // 0
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question