]> git.mxchange.org Git - flightgear.git/commitdiff
HUD::Tape: avoid floating point exception
authorTim Moore <timoore@redhat.com>
Fri, 6 Feb 2009 14:44:07 +0000 (15:44 +0100)
committerTim Moore <timoore@redhat.com>
Fri, 6 Feb 2009 14:44:07 +0000 (15:44 +0100)
src/Instrumentation/HUD/HUD_tape.cxx

index db9e68fef14f59f024a7898c376df2b05991fa91..89c4ceae93423dd3baea2c4e6ed7b030e981edbd 100644 (file)
@@ -64,7 +64,9 @@ HUD::Tape::Tape(HUD *hud, const SGPropertyNode *n, float x, float y) :
         _div_ratio = 0, _minor_divs = _major_divs;
 
 //    int k; //odd or even values for ticks            // FIXME odd scale
-    _odd_type = int(floorf(_input.max() + 0.5)) & 1 ? true : false;
+    _odd_type = false;
+    if (_input.max() + .5f < float(SGLimits<long>::max()))
+        _odd_type = long(floorf(_input.max() + 0.5f)) & 1 ? true : false;
 }