]> granicus.if.org Git - icu/commitdiff
Use uprv_fabs. (abs() is for integer types.)
authorHugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
Mon, 11 May 2020 18:19:50 +0000 (20:19 +0200)
committerHugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
Wed, 17 Jun 2020 20:39:05 +0000 (22:39 +0200)
icu4c/source/test/intltest/unitstest.cpp

index 9971793051cdec070015c60f36666f2d285c8b22..ab94df55dbda3f936beab86376319397a5941193 100644 (file)
@@ -13,6 +13,7 @@
 #include "filestrm.h"
 #include "intltest.h"
 #include "number_decimalquantity.h"
+#include "putilimp.h"
 #include "unicode/ctest.h"
 #include "unicode/measunit.h"
 #include "unicode/unistr.h"
@@ -194,7 +195,7 @@ void UnitsTest::testTemperature() {
 
         assertEquals(UnicodeString("testTemperature: ") + testCase.source + " to " + testCase.target,
                      testCase.expectedValue, converter.convert(testCase.inputValue),
-                     0.0001 * abs((double)testCase.expectedValue));
+                     0.0001 * uprv_fabs(testCase.expectedValue));
     }
 }