summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/TLpatches/patch-15-pow
blob: 6511855195d3ebc83451f5ba614ed69b309277b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	https://unicode-org.atlassian.net/browse/ICU-21896 (fixed upstream in 71.1)

	Else Solaris gets
libs/icu/icu-src/source/i18n/plurrule.cpp:1884:90:
error: call of overloaded 'pow(int, const int32_t&)' is ambiguous
	per https://tug.org/pipermail/tlbuild/2022q1/005020.html.

--- plurrule.cpp	(revision 61625)
+++ plurrule.cpp	(working copy)
@@ -1628,7 +1628,7 @@
     init(n, v, f, e);
     // check values. TODO make into unit test.
     //            
-    //            long visiblePower = (int) Math.pow(10, v);
+    //            long visiblePower = (int) Math.pow(10.0, v);
     //            if (decimalDigits > visiblePower) {
     //                throw new IllegalArgumentException();
     //            }
@@ -1881,7 +1881,7 @@
 
 double FixedDecimal::getPluralOperand(PluralOperand operand) const {
     switch(operand) {
-        case PLURAL_OPERAND_N: return (exponent == 0 ? source : source * pow(10, exponent));
+        case PLURAL_OPERAND_N: return (exponent == 0 ? source : source * pow(10.0, exponent));
         case PLURAL_OPERAND_I: return (double) longValue();
         case PLURAL_OPERAND_F: return static_cast<double>(decimalDigits);
         case PLURAL_OPERAND_T: return static_cast<double>(decimalDigitsWithoutTrailingZeros);
@@ -1932,14 +1932,14 @@
 }
 
 double FixedDecimal::doubleValue() const {
-    return (isNegative ? -source : source) * pow(10, exponent);
+    return (isNegative ? -source : source) * pow(10.0, exponent);
 }
 
 int64_t FixedDecimal::longValue() const {
     if (exponent == 0) {
         return intValue;
     } else {
-        return (long) (pow(10, exponent) * intValue);
+        return (long) (pow(10.0, exponent) * intValue);
     }
 }