if(val<=test)
std::cout<<"Both are Equal"<<std::endl;
///
The if loop may result to true if value ==0 but comparison of floating point values are not proper and violate the coding standard.
How can I carry out such a comparison??????????
Also ensure that floating point is really what you want.
Depending on the application, sometimes Decimal is more appropriate and you can avoid these issues.
For example, for money values, you want to use Decimal and not floating point.