+ 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
2 ответов
+ 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);
+ 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!