In my previous question Comparing a double and int, without casting or conversion, I found out how the the difference between two doubles was tripping the comparison.
I came accross the method setprecision(), which will help display all the numbers after decimal.
So, the difference of 6.15 and 3.15 was found to be : 3.00000000000000044408920985006
Now, when it gets compared with 3, it returns a result saying it is greater than 3.
How do I force it to take only a limited number of digits?
When I used 6.1 and 3.1, the difference was : 2.99999999999999955591079014994
How should I make the precision so that we know that it is actually equal to 3, and not less than.