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

Subject: batan2(1,0) not following global accuracy()
Date: Wed, 01 May 2013 06:50:23 +1000
To: bug-Math-BigInt [...]
From: Kevin Ryde <user42 [...]>
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.
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