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 364410 - Incorrectly rounded pi constant
Incorrectly rounded pi constant
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
5.8.x
Other All
: Normal minor
: ---
Assigned To: Rich Burridge
Rich Burridge
Depends on:
Blocks:
 
 
Reported: 2006-10-23 12:44 UTC by Sebastien Bacher
Modified: 2006-10-23 17:04 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
patch by PaulSchulz (769 bytes, patch)
2006-10-23 12:45 UTC, Sebastien Bacher
none Details | Review

Description Sebastien Bacher 2006-10-23 12:44:00 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/gcalctool/+bug/67408

"The real value of pi = 3.141592653589793238...
gcalctool thinks pi = 3.141592653
The value has been rounded down, it should have been rounded up.

The value in the source is longer than displayed in the GUI:
./gcalctool/get.c: init_constant(3, "3.1415926535"); /* pi */
So init_constant() seems to be rounding incorrectly.

The value in the source has also been rounded incorrectly, but that may not be the problem.
...
http://librarian.launchpad.net/4921664/gcalctool-5.8.24-ps1.diff
Correction to rounding of pi.

Hi there..

I have attached a patch to fix the second issue. (The value of PI as mentioned was confirmed in Wikipedia, which may or may not be definitive :-)
...
While I can confirm the new Pi value is rounded more correctly, I am not sure it makes any difference. I think we need to figure out what type the Pi value is stored in, and see if 3.1415926536 is already too many significant digits for that type."
Comment 1 Sebastien Bacher 2006-10-23 12:45:00 UTC
Created attachment 75237 [details] [review]
patch by PaulSchulz
Comment 2 Rich Burridge 2006-10-23 16:48:09 UTC
Change checked into CVS HEAD. I've updated the version
number in configure.in to 5.9.5. Closing as FIXED. Thanks!
Comment 3 Malcolm Parsons 2006-10-23 17:04:08 UTC
The incorrectly rounded value of pi is mentioned in the gcalctool doc and manpage too.