[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: |
Wed, 12 Oct 2022 16:17:20 -0400 (EDT) |
Follow-up Comment #1, bug #63203 (project octave):
forgot var also now gives an optional second output. expected results for
same tests below:
[v,m]=var(Inf)
[v,m]=var([1 2 Inf])
[v,m]=var([1 2 Inf]')
[v,m]=var([1 2 Inf],[],1)
[v,m]=var([1 2 Inf],[],2)
[v,m]=var([1 2 Inf; 2 3 4],[])
[v,m]=var([1 2 Inf; 2 3 Inf],[])
[v,m]=var(NaN)
[v,m]=var([1 2 NaN])
[v,m]=var([1 2 NaN]')
[v,m]=var([1 2 NaN],[],1)
[v,m]=var([1 2 NaN],[],2)
[v,m]=var([1 2 NaN; 2 3 4],[])
[v,m]=var([1 2 NaN; 2 3 NaN],[])
[v,m]=var([Inf 2 NaN])
[v,m]=var([Inf 2 NaN]')
[v,m]=var([Inf 2 NaN],[],1)
[v,m]=var([Inf 2 NaN],[],2)
[v,m]=var([1 2 Inf; 2 3 NaN],[])
[v,m]=var([1 2 NaN; 2 3 Inf],[])
in Matlab 2022b:
[v,m]=var(Inf)
v =
NaN
m =
Inf
[v,m]=var([1 2 Inf])
v =
NaN
m =
Inf
[v,m]=var([1 2 Inf]')
v =
NaN
m =
Inf
[v,m]=var([1 2 Inf],[],1)
v =
0 0 NaN
m =
1 2 Inf
[v,m]=var([1 2 Inf],[],2)
v =
NaN
m =
Inf
[v,m]=var([1 2 Inf; 2 3 4],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 Inf
[v,m]=var([1 2 Inf; 2 3 Inf],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 Inf
[v,m]=var(NaN)
v =
NaN
m =
NaN
[v,m]=var([1 2 NaN])
v =
NaN
m =
NaN
[v,m]=var([1 2 NaN]')
v =
NaN
m =
NaN
[v,m]=var([1 2 NaN],[],1)
v =
0 0 NaN
m =
1 2 NaN
[v,m]=var([1 2 NaN],[],2)
v =
NaN
m =
NaN
[v,m]=var([1 2 NaN; 2 3 4],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 NaN
[v,m]=var([1 2 NaN; 2 3 NaN],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 NaN
[v,m]=var([Inf 2 NaN])
v =
NaN
m =
NaN
[v,m]=var([Inf 2 NaN]')
v =
NaN
m =
NaN
[v,m]=var([Inf 2 NaN],[],1)
v =
NaN 0 NaN
m =
Inf 2 NaN
[v,m]=var([Inf 2 NaN],[],2)
v =
NaN
m =
NaN
[v,m]=var([1 2 Inf; 2 3 NaN],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 NaN
[v,m]=var([1 2 NaN; 2 3 Inf],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 NaN
in Octave 8.0.0:
[v,m]=var(Inf)
v = 0
m = Inf
[v,m]=var([1 2 Inf])
v = NaN
m = Inf
[v,m]=var([1 2 Inf]')
v = NaN
m = Inf
[v,m]=var([1 2 Inf],[],1)
v =
0 0 0
m =
1 2 Inf
[v,m]=var([1 2 Inf],[],2)
v = NaN
m = Inf
[v,m]=var([1 2 Inf; 2 3 4],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 Inf
[v,m]=var([1 2 Inf; 2 3 Inf],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 Inf
[v,m]=var(NaN)
v = 0
m = NaN
[v,m]=var([1 2 NaN])
v = NaN
m = NaN
[v,m]=var([1 2 NaN]')
v = NaN
m = NaN
[v,m]=var([1 2 NaN],[],1)
v =
0 0 0
m =
1 2 NaN
[v,m]=var([1 2 NaN],[],2)
v = NaN
m = NaN
[v,m]=var([1 2 NaN; 2 3 4],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 NaN
[v,m]=var([1 2 NaN; 2 3 NaN],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 NaN
[v,m]=var([Inf 2 NaN])
v = NaN
m = NaN
[v,m]=var([Inf 2 NaN]')
v = NaN
m = NaN
[v,m]=var([Inf 2 NaN],[],1)
v =
0 0 0
m =
Inf 2 NaN
[v,m]=var([Inf 2 NaN],[],2)
v = NaN
m = NaN
[v,m]=var([1 2 Inf; 2 3 NaN],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 NaN
[v,m]=var([1 2 NaN; 2 3 Inf],[])
v =
0.5000 0.5000 NaN
m =
1.5000 2.5000 NaN
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63203>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/