minmax operations on null piddles return weird results:
perldl> $y = null
perldl> p $y->minmax
perldl> p $y->min
perldl> p $y->max
i think they should blow up.
Logged In: YES
The problem is that min and max were being initialized
inside the thread loop. When there are no elements in the
piddle, the thread loop executes zero times, leaving random
memory contents in the return values.
The BAD case seems to do the right thing, labeling the
return values BAD for null piddles. The non-badvalue case
was broken. The Right Answer is arguably NaN for
non-badvalue perldl builds, but NaN doesn't work for integer
values; 0 is the next best choice. (I briefly flirted with
-1 max, +1 min, which is
clearly invalid, but 0 seems like a less bizarre choice.)
The code now returns 0 for null piddles.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.