You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (i=0; i<k-1; i++) { // #loop_counter_not_local_scope_ok
951
-
w *= x[i];
976
+
if (x[i] ==0.0) {
977
+
zerc++;
978
+
} else {
979
+
w *= x[i];
980
+
}
952
981
ans->dbl_v[i] =fill;
953
982
}
954
-
w *= x[i];
955
-
ans->dbl_v[i] = (double) w;
983
+
if (x[i] ==0.0) {
984
+
zerc++;
985
+
} else {
986
+
w *= x[i];
987
+
}
988
+
if (zerc) {
989
+
ans->dbl_v[i] =0.0;
990
+
} else {
991
+
ans->dbl_v[i] = (double) w;
992
+
}
956
993
if (R_FINITE((double) w)) {
957
994
for (uint64_ti=k; i<nx; i++) {
958
-
w /= x[i-k];
959
-
w *= x[i];
960
-
ans->dbl_v[i] = (double) w;
995
+
if (x[i-k] ==0.0) {
996
+
zerc--;
997
+
} else {
998
+
w /= x[i-k];
999
+
}
1000
+
if (x[i] ==0.0) {
1001
+
zerc++;
1002
+
} else {
1003
+
w *= x[i];
1004
+
}
1005
+
if (zerc) {
1006
+
ans->dbl_v[i] =0.0;
1007
+
} else {
1008
+
ans->dbl_v[i] = (double) w;
1009
+
}
961
1010
}
962
1011
if (!R_FINITE((double) w)) {
963
1012
if (hasnf==-1)
964
1013
ansSetMsg(ans, 2, "%s: has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning", __func__);
965
1014
if (verbose)
966
1015
ansSetMsg(ans, 0, "%s: non-finite values are present in input, re-running with extra care for NFs\n", __func__);
967
-
w=1.0; truehasnf= true;
1016
+
w=1.0; zerc=0; truehasnf= true;
968
1017
}
969
1018
} else {
970
1019
if (hasnf==-1)
971
1020
ansSetMsg(ans, 2, "%s: has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning", __func__);
972
1021
if (verbose)
973
1022
ansSetMsg(ans, 0, "%s: non-finite values are present in input, skip non-finite inaware attempt and run with extra care for NFs straighaway\n", __func__);
0 commit comments