if ( $p{nanoseconds} ) { # <-- +0 should fix it $self->{nanoseconds} = $p{nanoseconds}; $self->_normalize_nanoseconds; } else { # shortcut - if they don't need nanoseconds $self->{nanoseconds} = 0; } ... # and later # make the signs of seconds, nanos the same; 0 < abs(nanos) < MAX_NANOS # NB this requires nanoseconds != 0 (callers check this already) # <-- GOTCHA! sub _normalize_nanoseconds { ...