I am trying to create a histogram using GSL. I get a problem when I try to add to the histogram the value of the division 1470/100. This results in 14.69999999 and when added to the histogram it gets rounded to the lower bin. My question is how can i make 1470/100 result in 14.7 and not 14.69999? Thank you
Edit:
int minRange = 14;
double val;
val = minRange + j*0.05;
gsl_histogram_increment(hist, val);
When val is added to the histogram it is considered to be 14.65 instead of 14.7. (j is 14 in this case).
I solved the issue by adding 1e-6 to val. Thank you for the help