GNOME Bugzilla – Bug 364410
Incorrectly rounded pi constant
Last modified: 2006-10-23 17:04:08 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."
Created attachment 75237 [details] [review] patch by PaulSchulz
Change checked into CVS HEAD. I've updated the version number in configure.in to 5.9.5. Closing as FIXED. Thanks!
The incorrectly rounded value of pi is mentioned in the gcalctool doc and manpage too.