DateTime::Duration is_positive bug?

2003-06-10 Thread fglock
In DateTime::Duration: sub new(): ... unless ( grep { $self->{$_} } qw( months days ... { $self->{sign} = 0; } and then: sub is_positive { $_[0]->{sign} == 1 ? 1 : 0 } which makes a zero-duration be "not positive", because sign is zero. - Flavio S. Glock

Re: DateTime::Duration is_positive bug?

2003-06-10 Thread Dave Rolsky
On Wed, 11 Jun 2003 [EMAIL PROTECTED] wrote: > In DateTime::Duration: > > sub new(): > ... > unless ( grep { $self->{$_} } qw( months days ... > { > $self->{sign} = 0; > } > > > and then: > > sub is_positive { $_[0]->{sign} == 1 ? 1 : 0 } > > which makes a zero-duration b

Re: DateTime::Duration is_positive bug?

2003-06-11 Thread Flavio S. Glock
Dave Rolsky wrote: > > On Wed, 11 Jun 2003 [EMAIL PROTECTED] wrote: ... > > sub is_positive { $_[0]->{sign} == 1 ? 1 : 0 } > > > > which makes a zero-duration be "not positive", > > because sign is zero. > > That was an intentional change. Zero isn't positive, is it? That's right. I asked it