in reply to Histogramming -- Floating point numbers as hash keys

Typically, when I build histograms for floating point numbers, I have some level of binning required (ie, determining what the size of each catchment area is).

For instance, although the values might have 6 significant figures past 0, I don't want that the graph to deal with 10^6 datapoints -- I might only want 10^4, so rather than hashing on $value, I'll hash on &bin($value), where 'bin' is a function to strip the value to the precision I want. (which may not be a linear function)

If you really need the precision -- It's possible that PDL might be what you're looking for (at least, for the estimation of spectra, as I know there are folks that do physics number crunching with it, although I have no idea what it actually entails, not being a physicist myself).

Update I don't know why we got accused of graphing -- I guess you could graph in PDL, but unless there's a terminology difference, and you're using histogram differently than I'm used to, it is impossible to build a histogram of a continuously variable value -- you have to build a series of intervals -- and it's true for database indexing, you just don't get to see the implementation (it's actually computing what the appropriate sizes of the intervals are)

  • Comment on Re: Histogramming -- Floating point numbers as hash keys