If N and M are used as double, then for comparing them, can we do this:
if( N<=M ) { cout << "Yes"; }
If not then suggest what to do?
If N is long long and M is double, then for comparing them, can we do this:
if( N<=M ) { cout << "Yes"; }
If not then suggest what to do?
Comparison with double is causing me problem. So guide me what to do?
This is for n==m not n<=m. I am assuming EPS as epsilon.
where
eps=1e-6
or a smallest value;If N is long long and M is double, then for comparing them, this works right:
if( N<=M ) { cout << "Yes"; }
I am saying this because my sol to problem http://mirror.codeforces.com/contest/557/problem/B got accepted. Sol link: http://mirror.codeforces.com/contest/557/submission/12142795
Was this due to weak test cases or this works.
Okay I also want to confirm that value of epsilon should be taken as 10^(-9). I have found most of times that 10^(-6) or numeric::limits epsilon() gives WA.
Guide me on this?