Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: user42_kevin [...] yahoo.com.au
Cc:
AdminCc:

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



Subject: BigFloat overloaded int() changing its input
Date: Tue, 26 Apr 2016 16:37:06 +1000
To: bug-Math-BigInt [...] rt.cpan.org
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
Download (untitled) / with headers
text/plain 720b
With Math-BigInt 1.999719 on recent debian i386 perl 5.22.1, a program use strict; use Math::BigFloat; my $x = Math::BigFloat->new('0.5'); print "x is $x\n"; my $i = int($x); print "i is $i and x is now $x\n"; prints x is 0.5 i is 0 and x is now 0 I hoped int($x) would return a rounded value and leave its input $x unchanged. That being of course is how int() behaves on ordinary scalars, and I believe how previous BigFloat behaved too. This is per a report from Slaven Rezic on tests of some of my code failing https://rt.cpan.org/Ticket/Display.html?id=113960 and noting there the problem seems tickled by the immediately previous BigFloat 1.999718 in addition to 1.999719.
Thanks for the report. This is fixed in Math-BigInt v1.999720.
Fixed in Math-BigInt v1.999720.


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.