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
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
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