Bug 51672 - Some calculations, such as 1024x1024, yield results in scientific notation but should not
Summary: Some calculations, such as 1024x1024, yield results in scientific notation bu...
Status: RESOLVED FIXED
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Bernd Wuebben
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-09 08:10 UTC by rmedina
Modified: 2003-02-15 21:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fixes kcalc_core.cpp so semi-large numbers like 1048576 display correctly (704 bytes, patch)
2002-12-09 08:12 UTC, rmedina
Details

Note You need to log in before you can comment on or make changes to this bug.
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);
                         }