From 1bc036a235fffa88cd15d6e27c40a5733f475d6a Mon Sep 17 00:00:00 2001 From: MarkRivers Date: Tue, 16 Apr 2013 04:12:27 +0000 Subject: [PATCH] Use fabs, not abs --- motorApp/NewportSrc/AG_UC.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/motorApp/NewportSrc/AG_UC.cpp b/motorApp/NewportSrc/AG_UC.cpp index e6746c75..fdf06127 100644 --- a/motorApp/NewportSrc/AG_UC.cpp +++ b/motorApp/NewportSrc/AG_UC.cpp @@ -229,9 +229,9 @@ asynStatus AG_UCAxis::move(double position, int relative, double minVelocity, do int AG_UCAxis::velocityToSpeedCode(double velocity) { int speed; - if (abs(velocity) <= 5) speed = 1; - else if (abs(velocity) <= 100) speed = 2; - else if (abs(velocity) <= 666) speed = 4; + if (fabs(velocity) <= 5) speed = 1; + else if (fabs(velocity) <= 100) speed = 2; + else if (fabs(velocity) <= 666) speed = 4; else speed = 3; if (velocity < 0) speed = -speed; return speed;