From 6f09230cd8fa26dafbb0f8be6f6043d883d0a93a Mon Sep 17 00:00:00 2001 From: Dorai Sitaram Date: Fri, 17 May 2024 14:52:15 -0400 Subject: [PATCH] multiple-regression.js: gen'd predictor function shd check that all its arg tuple's elts are numbers #1732 --- src/js/trove/multiple-regression.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/trove/multiple-regression.js b/src/js/trove/multiple-regression.js index c0b58192c..6c95bd491 100644 --- a/src/js/trove/multiple-regression.js +++ b/src/js/trove/multiple-regression.js @@ -163,7 +163,9 @@ } let result = B[0][0]; for (let i = 0; i < x_s_len; i++) { - result += runtime.num_to_fixnum(js_x_s[i]) * B[i+1][0] + let x = js_x_s[i]; + runtime.checkNumber(x); + result += runtime.num_to_fixnum(x) * B[i+1][0] } return runtime.makeNumber(result); }