From: ehofman Date: Tue, 22 Jul 2003 08:13:10 +0000 (+0000) Subject: Fix a devide by zero bug"src/Autopilot/newauto.cxx X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e47c97844d0b5a764f9f46a3fccac86aa9b2a87d;p=flightgear.git Fix a devide by zero bug"src/Autopilot/newauto.cxx --- diff --git a/src/Autopilot/newauto.cxx b/src/Autopilot/newauto.cxx index e0bed6acd..5c2109ecd 100644 --- a/src/Autopilot/newauto.cxx +++ b/src/Autopilot/newauto.cxx @@ -871,7 +871,7 @@ FGAutopilot::update (double dt) double lookahead; // estimate speed in 10 seconds - lookahead = airspeed_node->getFloatValue() + ( airspeed_node->getFloatValue() - previous_speed) * (10/dt); + lookahead = airspeed_node->getFloatValue() + ( airspeed_node->getFloatValue() - previous_speed) * (10/(dt + 0.000001)); previous_speed = airspeed_node->getFloatValue(); // compare targetspeed to anticipated airspeed