Skip Menu |

This queue is for tickets about the Math-BigInt CPAN distribution.

Report information
The Basics
Id: 84953
Status: resolved
Priority: 0/
Queue: Math-BigInt

Owner: Nobody in particular
Requestors: user42 [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.999714

From gg [...] Tue Apr 30 16: 50:31 2013
MIME-Version: 1.0
X-Spam-Status: No, score=-6.751 tagged_above=-99.9 required=10 tests=[AWL=0.149, BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5] autolearn=ham
X-Spam-Flag: NO
Content-Type: multipart/mixed; boundary="=-=-="
Message-ID: <878v3zlp4g.fsf [...] blah.blah>
X-Virus-Scanned: Debian amavisd-new at
X-Spam-Score: -6.751
Received: from localhost (localhost []) by (Postfix) with ESMTP id C78592408F5 for <cpan-bug+Math-BigInt [...]>; Tue, 30 Apr 2013 16:50:31 -0400 (EDT)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 5MxUX-2BkMN1 for <cpan-bug+Math-BigInt [...]>; Tue, 30 Apr 2013 16:50:29 -0400 (EDT)
Received: from ( []) by (Postfix) with SMTP id 285A72408E6 for <bug-Math-BigInt [...]>; Tue, 30 Apr 2013 16:50:28 -0400 (EDT)
Received: (qmail 6345 invoked by alias); 30 Apr 2013 20:50:28 -0000
Received: from (HELO ( by (qpsmtpd/0.28) with ESMTP; Tue, 30 Apr 2013 13:50:21 -0700
Received: from ( []) by (Postfix) with ESMTP id 6870A397406 for <bug-Math-BigInt [...]>; Wed, 1 May 2013 06:50:14 +1000 (EST)
Received: from blah.blah (unknown []) by (Postfix) with ESMTP id C87C45780C0 for <bug-Math-BigInt [...]>; Wed, 1 May 2013 06:50:13 +1000 (EST)
Received: from gg by blah.blah with local (Exim 4.80) (envelope-from <gg [...]>) id 1UXHVH-0005zN-2o for bug-Math-BigInt [...]; Wed, 01 May 2013 06:50:23 +1000
Delivered-To: cpan-bug+Math-BigInt [...]
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Subject: batan2(1,0) not following global accuracy()
Return-Path: <gg [...]>
X-RT-Mail-Extension: math-bigint
X-Original-To: cpan-bug+Math-BigInt [...]
Date: Wed, 01 May 2013 06:50:23 +1000
To: bug-Math-BigInt [...]
From: Kevin Ryde <user42 [...]>
X-RT-Interface: Email
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: ascii
Content-Length: 769
Download (untitled) / with headers
text/plain 769b
In Math::BigFloat 1.997 and recent debian i386 perl 5.14.3, if a global Math::BigFloat->accuracy(100) has been set then batan2() of Y=1,X=0 only gives 40 decimal places of accuracy, not the requested 100. Eg. the program below prints 1.570796326794896619231321691639751442098000000000000000000000000000000000000000000000000000000000000 whereas I expected the trailing 0s to be some non-zero value. If $x is some small non-zero value, such as 1e-10 then the desired full 100 decimals are returned. In the code I wonder if the special cases for X=0 and Y=0 giving pi/2 etc could look also at the accuracy() and/or precision setting on $y or $x or global or whatever, so as to ensure the result in those cases is the same accuracy as the general case.
Content-Type: text/x-perl
Content-Disposition: inline; filename=""
Content-Length: 157
text/x-perl 157b
use strict; use Math::BigFloat; Math::BigFloat->accuracy(100); my $y = Math::BigFloat->new(1); my $x = Math::BigFloat->new(0); $y->batan2($x); print "$y\n";

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to