+ 2

Why is 0?

The Monte Carlo method is older than our programming world and was used in probability theory before the creation of C. Sharp itself, but why 0 can this code output something else or does it only output zero? https://sololearn.com/compiler-playground/cPHns4XKzBDy/?ref=app

29th Dec 2024, 9:55 PM
Разин Ярослав Александрович
Разин Ярослав Александрович - avatar
2 odpowiedzi
+ 2
If your goal is to have the result of the actual division as a double, you will need some double variable for that. Console.WriteLine("Вероятность события A: {0}", (double) countA / iterations); Console.WriteLine("Вероятность события B: {0}", (double) countB / iterations);
30th Dec 2024, 1:37 AM
SoloProg
SoloProg - avatar
+ 1
0 is basically nothing, and it represents nothing. If the universe was 0, then it wouldn't exists, so the big question is - has the universe ever been 0. Can anything grow out of nothing, since nothing doesn't exists!
29th Dec 2024, 11:13 PM
Jan
Jan - avatar