Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

Division of 0 by a double not 0?

$
0
0

solution code: http://www.codechef.com/viewsolution/7482546 problem : SEAGM2, JULy15

in the solve function,

ld ans=win/r;
if(win==0) ans=0; //solution fails for 10 points but passes for 90 points, after removing this line
printf("%0.6Lf\n",ans);

Why is equating ans to 0 required if numerator is 0, shouldn't ans be 0 too?


Viewing all articles
Browse latest Browse all 39796


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>