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

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

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 [...]
From: Kevin Ryde <user42_kevin [...]>
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 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 infrastructure.

Please report any issues with to