summaryrefslogtreecommitdiff
path: root/app-i18n/sunpinyin/files/sunpinyin-2.0.4-gcc-6.patch
blob: 0bceb38318b31b5777f17345dc5bd07b1f6b8091 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
https://bugs.gentoo.org/553796

Author: Peter Levine <plevine457@gmail.com>

--- a/src/slm/tslmpack/common.h
+++ b/src/slm/tslmpack/common.h
@@ -53,10 +53,10 @@
 typedef std::map<float, int> RealIndexMap;  // map real values to their indices
 typedef std::map<std::string, unsigned int> TLexicon; // map word to wid
 
-#define EffectivePr(a)  (float((usingLogPr) ? ((a) / log(2.0)) : (-log2((a)))))
-#define OriginalPr(b)   (float((usingLogPr) ? ((b) * log(2.0)) : (exp2(-(b)))))
-#define EffectiveBow(a) (float((usingLogPr) ? (exp(-(a))) : ((a))))
-#define OriginalBow(b)  (float((usingLogPr) ? (-log((b))) : ((b))))
+#define EffectivePr(a)  (float((usingLogPr) ? ((a) / logf(2.0f)) : (-log2f((a)))))
+#define OriginalPr(b)   (float((usingLogPr) ? ((b) * logf(2.0f)) : (exp2f(-(b)))))
+#define EffectiveBow(a) (float((usingLogPr) ? (expf(-(a))) : ((a))))
+#define OriginalBow(b)  (float((usingLogPr) ? (-logf((b))) : ((b))))
 
 #endif //_SLM_PACK_COMMON_H