Bug 51672

Summary: Some calculations, such as 1024x1024, yield results in scientific notation but should not
Product: [Applications] kcalc Reporter: rmedina
Component: generalAssignee: Bernd Wuebben <wuebben>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Fixes kcalc_core.cpp so semi-large numbers like 1048576 display correctly

Description rmedina 2002-12-09 08:10:15 UTC
Version:           1.3.2 (using KDE 3.0.9)
Compiler:          gcc version 3.1
OS:          Linux (i686) release 2.4.19

I  calculate things such as 1024x1024 all the time and I hate having to find 
 xcalc every time. I thought the problem had to do with not compiling it with 
 long double precision, but it definately is compiled correctly. It has been this way for quite 
 some time.
Comment 1 rmedina 2002-12-09 08:12:08 UTC
Created attachment 588 [details]
Fixes kcalc_core.cpp so semi-large numbers like 1048576 display correctly

I don't know if this is the best or correct way to fix the problem, but it
appears to work for me.
Comment 2 George Staikos 2003-02-15 21:52:59 UTC
Subject: KDE_3_1_BRANCH: kdeutils/kcalc [POSSIBLY UNSAFE]

CVS commit by staikos: 

Apply patch contributed in bug report #51672 months ago.  It works for me so
I think it's good to apply.

CCMAIL: 51672-done@bugs.kde.org


  M +2 -2      kcalc_core.cpp   1.59.2.1 [POSSIBLY UNSAFE: printf]


--- kdeutils/kcalc/kcalc_core.cpp  #1.59:1.59.2.1
@@ -1677,5 +1677,5 @@ void QtCalculator::UpdateDisplay()
                                                         DISPLAY_AMOUNT);
                         } else {
-                                str_size = snprintf(display_str, DSP_SIZE, PRINT_LONG, DISPLAY_AMOUNT);
+                                str_size = snprintf(display_str, DSP_SIZE, PRINT_LONG_BIG, kcalcdefaults.precision, DISPLAY_AMOUNT);
                         }