From: Torsten D. <To...@t3...> - 2009-09-15 13:15:28
|
> On 14 Sep 2009, at 16:54, Torsten Dreyer wrote: > > But I can provide a fix for a potential division by zero bug: Some > > stations > > don't have a range configured and bomb here: > > double range_exceed_norm = loc_dist/effective_range_m; > > Thanks Torsten, I fixed this slightly differently, but a good catch. I > wonder if I should also warn about such navids at startup, so we can > get the nav.dat entries fixed? You should include 0.0 to avoid div by zero: if (nominalRange <= 0.0) { nominalRange = FG_NAV_DEFAULT_RANGE; } I dont't think it's worth a warning, nothing bad happens if we substitute zero with the default range. A range of zero might be defined as "unknown" or "undefined". How do you think about enabling/disabling certain features of the navradio by property-settings, like "enable-sidelobes"? Torsten |