octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63203] std and var return 0 instead of NaN fo


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #63203] std and var return 0 instead of NaN for some Inf and NaN inputs
Date: Sat, 15 Oct 2022 08:49:47 -0400 (EDT)

Follow-up Comment #2, bug #63203 (project octave):

turned out to be a one line fix.  the 'error' was only occurring within the
simplified codepath when the numel in direction dim was 1, which normally
shortcut to retval = zeros(size(x)).  since the default branch still only has
single output from var and std, adding a conditional " retval(isnan (x) |
isinf (x)) = NaN " fixes that case and all tests below pass.

Added that bugfix to var, BISTs for the single output, and pushed to stable
as: 
http://hg.savannah.gnu.org/hgweb/octave/rev/3b16c2d90326

(will resolve the merge conflict then correct for the variable name change and
add the two output tests to default)


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63203>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]