Commit 88e72355 authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed accurance of log function + real value output on Linux w/Russian

locale
parent 3e319d5f
...@@ -416,7 +416,10 @@ public: ...@@ -416,7 +416,10 @@ public:
} }
inline static real lg(real x) { inline static real lg(real x) {
if (x>0.0) { if (x>0.0) {
return ::log(x)/::log(10.0); real num = ::log(x);
real den = ::log((real)10.0);
real result = num / den;
return result;
} }
else { else {
Core::abort(Core::fromUtf8("Логарифм от не положительного числа")); Core::abort(Core::fromUtf8("Логарифм от не положительного числа"));
...@@ -904,6 +907,10 @@ public: ...@@ -904,6 +907,10 @@ public:
if (rightSpaces>0) if (rightSpaces>0)
result.append(rightSpaces, ' '); result.append(rightSpaces, ' ');
} }
for (size_t i=0; i<result.length(); i++) {
if (result[i]==',')
result[i] = '.';
}
if (!expform) { if (!expform) {
int chopPos; int chopPos;
bool dotFound = false; bool dotFound = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment