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

Mathew Mrosko
Tue May 17 07:54:58 PDT 2011


 Dan,

 I didn't do any complete testing, but FWIW I did clone from my VX-7R, 
 make a few changes (adding a handful of new repeaters), and clone back 
 successfully.  I won't have time tonight to do any more playing, but 
 maybe if I have some downtime at work today.

 Mat

 On Mon, 16 May 2011 18:31:10 -0700, Dan Smith wrote:
> 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!




More information about the chirp_devel mailing list