Yes, well the OP hasn't even responded as of yet and we have already accumulated 1050 views on this thread. We should give this a break.
Yes, well the OP hasn't even responded as of yet and we have already accumulated 1050 views on this thread. We should give this a break.
Not really, because it amounts to paying attention to noise.
You just have to accept the a histogram is a noisy representation of the data. If you are trying to make decisions in a way that would be influenced by sample flip-flopping due to noise, then you are using the histogram in a way that is not justifiable.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
That's ridiculous. There's nothing sloppy about it.
A value can only end up affecting the height of the wrong bar if the rounding caused by storing the number in the float data type to begin actually pushes the value across the logical boundary between bars. That's an error rate of 1 in 2^25! I.e. 1 in 32 million. Even if the original poster produced 100 histograms, from 100 data values each, the chance that even one of those values would end up in mathematically the wrong bar is still under 1 in 1000, and that unlucky data point was so damn near the boundary that it practically had just about as much right to end up where it did anyway.
It does not make the graph wrong!
At the end of the day its only usage it to provide a rough estimation of the distribution of the data, and the person viewing it simply has no basis for treating the result any differently to what one produced from an infinitely accurate data type could produce. In all practicality, your argument is just pointless nonsense.
Yes I have coded histograms in a professional product,.
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
You are right in that this should not be a particularly large error rate, but you are wrong assuming that it is constant. The rounding error is dependent on other things not accounted for here such as: compiler, architecture (specifically native floating point register design) and even weird things such as the number of instructions between your floating point variable initialization and its subsequent use in a local function. A compiler may choose to optimize the code or send things out of order for speculative execution.
Yes, using a float is sufficient. Using a double is doing the best you can do.