summaryrefslogtreecommitdiff
path: root/deps/icu-small/source/i18n/reldatefmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'deps/icu-small/source/i18n/reldatefmt.cpp')
-rw-r--r--deps/icu-small/source/i18n/reldatefmt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/deps/icu-small/source/i18n/reldatefmt.cpp b/deps/icu-small/source/i18n/reldatefmt.cpp
index 5cf053db9a..42ede7ae4d 100644
--- a/deps/icu-small/source/i18n/reldatefmt.cpp
+++ b/deps/icu-small/source/i18n/reldatefmt.cpp
@@ -14,6 +14,7 @@
#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
+#include <cmath>
#include "unicode/dtfmtsym.h"
#include "unicode/ucasemap.h"
#include "unicode/ureldatefmt.h"
@@ -849,7 +850,7 @@ UnicodeString& RelativeDateTimeFormatter::formatNumeric(
return appendTo;
}
UDateDirection direction = UDAT_DIRECTION_NEXT;
- if (offset < 0) {
+ if (std::signbit(offset)) { // needed to handle -0.0
direction = UDAT_DIRECTION_LAST;
offset = -offset;
}