[chirp_devel] [RFC] Convert to "integral hertz" for frequency storage

Dan Smith
Mon May 16 18:31:10 PDT 2011


Hi all,

Right now, chirp stores frequencies as a floating point number.  That's 
convenient (at times) but is fatally flawed because the internal 
representation is Base-2.  That leads to odd behavior like this:

   $ python
   >>> 130.8 * 100
   13080.000000000002

There are many places where this bites users and results in very odd 
behavior.  The correct way to fix this is to store the frequency in 
units of Hertz, which we can represent cleanly with an integer.  This is 
a straightforward change, but a wide-sweeping one.  I've spent many 
hours doing my best to carefully convert every driver in the tree to 
this mode of operation, as well as all the UI elements.  The automated 
tests have made this much easier, but there is still the extreme 
possibility for errors.

I would really (really) appreciate it if you developer-types could clone 
the following tree and bang around on it a bit:

   http://d-rats.com/hg/hgwebdir.cgi/chirp-intHz.hg/

After an initial sniff-test here, I'll push it into the main repository 
and hope for some more wide-spread testing.

Thanks!

-- 
Dan Smith
www.danplanet.com
KK7DS



More information about the chirp_devel mailing list