"pi" doesn't return a result to the number of places desired

Bug #128851 reported by Conrad Knauer
6
Affects Status Importance Assigned to Milestone
cln (Debian)
Fix Released
Unknown
cln (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: pi

I'm running Feisty current to the repositories. I installed the package "pi" and according to its man page:

---
SYNOPSIS
       pi [digits]

DESCRIPTION
       The pi command prints 100 decimal digits of Archimedes’ constant pi or
       a number of digits specified by an integer parameter on the command
       line.
---

However, it doesn't quite seem to get the number of digits right.

If I type "pi" it returns:

3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148

which is NOT 100 digits, nor to 100 decimal places:

3.
1415926535
8979323846
2643383279
5028841971
6939937510
5820974944
5923078164
0628620899
8628034825
3421170679
82148

so to 105 decimal places or a total of 106 digits.

If you use the option of supplying the number, it gets even weirder:

"pi 1" to "pi 3" returns:
3.1416
"pi 4" to "pi 5" returns:
3.1415927
"pi 6" to "pi 14" returns:
3.141592653589793
etc.

Revision history for this message
Conrad Knauer (atheoi) wrote :

Ooo! And I just noticed, by the example I gave, that the naughty thing rounds the last digit too! That should definitely be mentioned in the manual OR fixed so that it doesn't do that.

Revision history for this message
xtknight (xt-knight) wrote :

Confirmed here. Definitely a bug.

Changed in cln:
status: New → Confirmed
Revision history for this message
xtknight (xt-knight) wrote :

I sent an e-mail to the GiNaC mailing list (that now maintains libcln). I will keep you posted of the response. Also it is Debian debbug #286266 and a patch will be sent upstream if necessary.

Changed in cln:
status: Unknown → New
Revision history for this message
xtknight (xt-knight) wrote :

I'm sorry to say I haven't heard much. Check Debian bug #286266 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=286266

Revision history for this message
xtknight (xt-knight) wrote :

Fixed upstream.

Rounding does not occur on this version. Also, it only prints the number of digits specified, or 100 if unspecified.

Could someone please take a look at this patch (a backport of the fixed pi.cc)?

Revision history for this message
Barry deFreese (bddebian) wrote :

Uploaded. Thanks for the patch!

Changed in cln:
status: Confirmed → Fix Committed
Revision history for this message
xtknight (xt-knight) wrote :

cln (1.1.13-2ubuntu1) gutsy; urgency=low

  * Fix "pi" example program so that only the specified number of digits is
    printed. (LP: #128851)
  * Change Maintainer to Ubuntu MOTU Developers per DebianMaintainerField
    spec.

 -- Andy Matteson <email address hidden> Thu, 04 Oct 2007 16:08:33 -0400

Changed in cln:
status: Fix Committed → Fix Released
Changed in cln:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.