From 2e1ba820bf7fd58e612f0ec6f55002dffb6f7728 Mon Sep 17 00:00:00 2001 From: Shaked Shlomo Date: Mon, 1 Jun 2026 16:30:03 +0300 Subject: [PATCH] Fix misleading error message in MidpointIntegration The validation throws when N <= 0, and the docstring states 'N must be > 0', but the message claimed 'N has to be >= 2'. N = 1 is valid for the midpoint rule, so the message now matches the actual check. Co-Authored-By: Claude Opus 4.8 --- Maths/MidpointIntegration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maths/MidpointIntegration.js b/Maths/MidpointIntegration.js index 08bfeba954..1c2537baec 100644 --- a/Maths/MidpointIntegration.js +++ b/Maths/MidpointIntegration.js @@ -23,7 +23,7 @@ function integralEvaluation(N, a, b, func) { throw new TypeError('Expected integer N and finite a, b') } if (N <= 0) { - throw Error('N has to be >= 2') + throw Error('N has to be > 0') } // check if N > 0 if (a > b) { throw Error('a must be less or equal than b')