Skip Menu |

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

Report information
The Basics
Id: 95141
Status: resolved
Priority: 0/
Queue: Math-NumSeq

People
Owner: Nobody in particular
Requestors: DANAJ [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 70
Fixed in: 71



Subject: Powerful with power < 2
I think this is correct: Show quoted text
> perl -MMath::NumSeq::Powerful -E 'my $seq = Math::NumSeq::Powerful->new(powerful_type=>"all",power=>1); say join " ", map { ($seq->next)[1] } 1..20'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 but this is not: Show quoted text
> perl -MMath::NumSeq::Powerful -E 'my $seq = Math::NumSeq::Powerful->new(powerful_type=>"some",power=>1); say join " ", map { ($seq->next)[1] } 1..20'
4 8 9 12 16 18 20 24 25 27 28 32 36 40 44 45 48 49 50 52 Both types when given power=>0 do: Illegal division by zero at [...]/Powerful.pm line 130.
Subject: Re: [rt.cpan.org #95141] Powerful with power < 2
Date: Tue, 29 Apr 2014 10:00:07 +1000
To: DANAJ [...] cpan.org, bug-Math-NumSeq [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Dana Jacobsen via RT" <bug-Math-NumSeq@rt.cpan.org> writes: Show quoted text
> > but this is not: >
> > perl -MMath::NumSeq::Powerful -E 'my $seq = > > Math::NumSeq::Powerful->new(powerful_type=>"some",power=>1); say > > join " ", map { ($seq->next)[1] } 1..20'
> 4 8 9 12 16 18 20 24 25 27 28 32 36 40 44 45 48 49 50 52
Hmm. I think I only intended power >= 2 though the docs don't say so.
On Mon Apr 28 20:00:31 2014, user42@zip.com.au wrote: Show quoted text
> "Dana Jacobsen via RT" <bug-Math-NumSeq@rt.cpan.org> writes:
> > > > but this is not: > >
> > > perl -MMath::NumSeq::Powerful -E 'my $seq = > > > Math::NumSeq::Powerful->new(powerful_type=>"some",power=>1); say > > > join " ", map { ($seq->next)[1] } 1..20'
> > 4 8 9 12 16 18 20 24 25 27 28 32 36 40 44 45 48 49 50 52
> > Hmm. I think I only intended power >= 2 though the docs don't say so.
I was thinking of the way PrimeIndexPrimes works, where it's interesting at level=2, but level = 1 and level = 0 do the logical extension. In this case, power=>0 is dubiously useful, with the only concern being the error. I think just adding a note to the documentation is fine as well, perhaps indicating it is undefined with power < 2.
I think I updated the docs in version 71.