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)


In reply to Re: Histogramming -- Floating point numbers as hash keys by jhourcle
in thread Histogramming -- Floating point numbers as hash keys by dokkeldepper

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.