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

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



From gg [...] zip.com.au 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 bestpractical.com
X-Spam-Score: -6.751
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id C78592408F5 for <cpan-bug+Math-BigInt [...] hipster.bestpractical.com>; Tue, 30 Apr 2013 16:50:31 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5MxUX-2BkMN1 for <cpan-bug+Math-BigInt [...] hipster.bestpractical.com>; Tue, 30 Apr 2013 16:50:29 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 285A72408E6 for <bug-Math-BigInt [...] rt.cpan.org>; Tue, 30 Apr 2013 16:50:28 -0400 (EDT)
Received: (qmail 6345 invoked by alias); 30 Apr 2013 20:50:28 -0000
Received: from mailout1-14.pacific.net.au (HELO mailout3-syd3.pacific.net.au) (125.255.80.133) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Tue, 30 Apr 2013 13:50:21 -0700
Received: from mailproxy3-syd3.pacific.net.au (mailproxy3-syd3.pacific.net.au [61.8.2.164]) by mailout3-syd3.pacific.net.au (Postfix) with ESMTP id 6870A397406 for <bug-Math-BigInt [...] rt.cpan.org>; Wed, 1 May 2013 06:50:14 +1000 (EST)
Received: from blah.blah (unknown [203.26.175.202]) by mailproxy3-syd3.pacific.net.au (Postfix) with ESMTP id C87C45780C0 for <bug-Math-BigInt [...] rt.cpan.org>; Wed, 1 May 2013 06:50:13 +1000 (EST)
Received: from gg by blah.blah with local (Exim 4.80) (envelope-from <gg [...] zip.com.au>) id 1UXHVH-0005zN-2o for bug-Math-BigInt [...] rt.cpan.org; Wed, 01 May 2013 06:50:23 +1000
Delivered-To: cpan-bug+Math-BigInt [...] hipster.bestpractical.com
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Subject: batan2(1,0) not following global accuracy()
Return-Path: <gg [...] zip.com.au>
X-RT-Mail-Extension: math-bigint
X-Original-To: cpan-bug+Math-BigInt [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Date: Wed, 01 May 2013 06:50:23 +1000
X-Spam-Level:
To: bug-Math-BigInt [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
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 atan2.pl 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="atan2.pl"
Content-Length: 157
Download atan2.pl
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 Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.