0

I don't know why this code below is giving me "no". I tried to cast -0.2 to double and still getting "no"? What is the problem and how to fix it?

double d = -4;

double d1= -4.2;

if (d1== (d-0.2))
    cout<< "yes"<<endl;
else
    cout <<"no"<<endl;
timrau
  • 22,578
  • 4
  • 51
  • 64
Mariya
  • 847
  • 1
  • 9
  • 25

0 Answers0