aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2016-10-25 08:50:14 -0400
committerKen Moore <ken@ixsystems.com>2016-10-25 08:50:14 -0400
commit52b42cfa1021edba7a71f47a7c537f24790b9ff5 (patch)
tree107524332cb89c53ada7c3372cc05a7392c17432 /src-qt5/desktop-utils/lumina-calculator/mainUI.cpp
parentFix the "sticky" status on the wallpaper widgets. (diff)
downloadlumina-52b42cfa1021edba7a71f47a7c537f24790b9ff5.tar.gz
lumina-52b42cfa1021edba7a71f47a7c537f24790b9ff5.tar.bz2
lumina-52b42cfa1021edba7a71f47a7c537f24790b9ff5.zip
Fix up the double-precision calculation of equations within parentheses.
Now (3*(1/3)) properly equals 1 instead of 0.9999999
Diffstat (limited to 'src-qt5/desktop-utils/lumina-calculator/mainUI.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-calculator/mainUI.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp b/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp
index 1ea925cd..b26acb73 100644
--- a/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp
@@ -143,7 +143,7 @@ double mainUI::strToNumber(QString str){
//qDebug() << "Replace value:" << str << start << end << str.mid(start+1,end-start);
double tmp = strToNumber( str.mid(start+1, end-start-1));
if(tmp!=tmp){ return BADVALUE; } //not a number
- str.replace(start, end-start+1, QString::number( tmp ) );
+ str.replace(start, end-start+1, QString::number( tmp, 'e', 16) ); //need as high precision as possible here - internal only, never seen
//qDebug() << "Replaced:" << str;
}
// -------------------------------------
bgstack15