mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
fix: apply correct bounds to sf and tf (#5274)
This commit is contained in:
parent
9760221214
commit
fbb572a180
@ -955,11 +955,11 @@ func newRollupHoltWinters(args []interface{}) (rollupFunc, error) {
|
||||
return rfa.prevValue
|
||||
}
|
||||
sf := sfs[rfa.idx]
|
||||
if sf <= 0 || sf >= 1 {
|
||||
if sf < 0 || sf > 1 {
|
||||
return nan
|
||||
}
|
||||
tf := tfs[rfa.idx]
|
||||
if tf <= 0 || tf >= 1 {
|
||||
if tf < 0 || tf > 1 {
|
||||
return nan
|
||||
}
|
||||
|
||||
|
@ -470,12 +470,12 @@ func TestRollupHoltWinters(t *testing.T) {
|
||||
}
|
||||
|
||||
f(-1, 0.5, nan)
|
||||
f(0, 0.5, nan)
|
||||
f(1, 0.5, nan)
|
||||
f(0, 0.5, -856)
|
||||
f(1, 0.5, 34)
|
||||
f(2, 0.5, nan)
|
||||
f(0.5, -1, nan)
|
||||
f(0.5, 0, nan)
|
||||
f(0.5, 1, nan)
|
||||
f(0.5, 0, -54.1474609375)
|
||||
f(0.5, 1, 25.25)
|
||||
f(0.5, 2, nan)
|
||||
f(0.5, 0.5, 34.97794532775879)
|
||||
f(0.1, 0.5, -131.30529492371622)
|
||||
|
Loading…
Reference in New Issue
Block a user