Skip Menu |
 

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

Report information
The Basics
Id: 70235
Status: rejected
Priority: 0/
Queue: Math-BigInt

People
Owner: Nobody in particular
Requestors: pauloedgarcastro [...] gmail.com
Cc:
AdminCc:

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



Subject: Math::BigInt->new(1/2)->is_int ?!?!?!?
Date: Fri, 12 Aug 2011 15:39:02 +0100
To: bug-Math-BigInt [...] rt.cpan.org
From: Paulo Edgar Castro <pauloedgarcastro [...] gmail.com>
Download (untitled) / with headers
text/plain 589b
perl -MMath::BigInt -e 'print "Ups\n" if Math::BigInt->new(1/2)->is_int' Please let me know if you can't reproduce it. Regards, PECastro [pecastro@brutalix ~]$ perl -MMath::BigInt\ 999 Math::BigFloat version 999 required--this is only version 1.993. BEGIN failed--compilation aborted. [pecastro@brutalix ~]$ perl -v This is perl 5, version 12, subversion 4 (v5.12.4) built for x86_64-linux-thread-multi ....... [pecastro@brutalix ~]$ uname -a Linux brutalix 3.1.0-rc1PEC20-00087-g19a17ab #1 SMP PREEMPT Thu Aug 11 00:04:02 BST 2011 x86_64 x86_64 x86_64 GNU/Linux
Download (untitled) / with headers
text/plain 305b
On Fri Aug 12 10:39:18 2011, pauloedgarcastro@gmail.com wrote: Show quoted text
> perl -MMath::BigInt -e 'print "Ups\n" if Math::BigInt->new(1/2)->is_int'
I can reproduce it, but where is the bug? The expression "Math::BigInt->new(1/2)" gives a zero, just like "int(1/2)". Since zero is an integer, is_int() returns true.
Subject: Re: [rt.cpan.org #70235] Math::BigInt->new(1/2)->is_int ?!?!?!?
Date: Fri, 12 Aug 2011 20:14:44 +0100
To: bug-Math-BigInt [...] rt.cpan.org
From: Paulo Edgar Castro <pauloedgarcastro [...] gmail.com>
Download (untitled) / with headers
text/plain 690b
Hi Peter, I'm sorry I misunderstood the API. From the brief bits I had seen I thought it was more of a general purpose numeric library. The penny only dropped when I saw your comment "Math::BigInt->new(1/2)" gives a zero. Regards, PECastro On 12/08/11 18:44, Peter John Acklam via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=70235> > > On Fri Aug 12 10:39:18 2011, pauloedgarcastro@gmail.com wrote:
>> perl -MMath::BigInt -e 'print "Ups\n" if Math::BigInt->new(1/2)->is_int'
> I can reproduce it, but where is the bug? The expression > "Math::BigInt->new(1/2)" gives a zero, just like "int(1/2)". Since zero > is an integer, is_int() returns true. >
Download (untitled) / with headers
text/plain 201b
On Fri Aug 12 15:14:56 2011, pauloedgarcastro@gmail.com wrote: Show quoted text
> From the brief bits I had seen I thought it was more of a general > purpose numeric library.
You probably want to use Math::BigFloat.
Download (untitled) / with headers
text/plain 115b
This is an invalid ticket. BigInt->new(1/2) is supposed to truncate, per documentation. Please close this ticket.
Subject: Re: [rt.cpan.org #70235] Math::BigInt->new(1/2)->is_int ?!?!?!?
Date: Tue, 10 Jul 2012 20:13:49 +0100
To: bug-Math-BigInt [...] rt.cpan.org
From: Paulo Edgar Castro <pauloedgarcastro [...] gmail.com>
Download (untitled) / with headers
text/plain 435b
Hi Brendan It seems I opened the ticket via email submission which doesn't correspond to my cpan user id. I don't have the permissions to close it or reject it. Regards, PECastro On 09/07/12 19:44, Brendan Byrd via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=70235> > > This is an invalid ticket. BigInt->new(1/2) is supposed to truncate, > per documentation. > > Please close this ticket. >
The behaviour is as expected and as documented.


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.