After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696986 - Wrong answer during modulo calculations
Wrong answer during modulo calculations
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
6.6.x
Other Linux
: Normal critical
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on: 698400
Blocks:
 
 
Reported: 2013-03-31 18:24 UTC by david
Modified: 2013-05-20 11:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixed modulo calculations. (2.41 KB, patch)
2013-05-19 19:54 UTC, Garima Joshi
committed Details | Review
Added fix for negative exponents. (978 bytes, patch)
2013-05-19 21:16 UTC, Garima Joshi
committed Details | Review

Description david 2013-03-31 18:24:18 UTC
When using gnome-calculator to calculate the following

(10^(223728)) mod 1234567891

the gnome calculator incorrectly (and without any indication something went wrong) gives back the answer 0. The correct answer however should be 83494518

Im running 64-bit ubuntu 12.10 on an HP pavilion dv6 laptop containing an intel core i3 M 350 presenting 4 cores to the system
Comment 1 Andrea Basso 2013-04-08 21:13:03 UTC
The error lies not in the operation itself, but in the fact that 10^(223728) is a number too big for gnome-calculator to handle. Indeed, writing 10^(223728) and pressing enter returns 0 (as it does for much smaller inputs, like 10^1000).
Comment 2 david 2013-04-09 08:06:47 UTC
10^223728 is not too large for the gnome-calculator. Using my default settings it just displays as 1*10^223728  after pressing enter and some significant wait (I use scientific as number format)
Comment 3 Garima Joshi 2013-05-19 19:54:27 UTC
Created attachment 244732 [details] [review]
Fixed modulo calculations.
Comment 4 PioneerAxon 2013-05-19 20:48:42 UTC
Review of attachment 244732 [details] [review]:

Committed..

Thank you. :)
Comment 5 Garima Joshi 2013-05-19 21:16:51 UTC
Created attachment 244735 [details] [review]
Added fix for negative exponents.
Comment 6 PioneerAxon 2013-05-20 11:13:26 UTC
Review of attachment 244735 [details] [review]:

Committed..

Thank you.. :)