Here is a simple code in c++ and the output is different from what I expected
#include<iostream>
using namespace std;
int main()
{
double a=0,b=1;
while(a<b)
{
cout<<a<<endl;
a+=0.1;
}
}
Output prints the value till 1 instead of stopping at 0.9. Please help me understand the reason behind this.