From: Chris Duncan Date: Fri, 17 Jan 2025 16:17:13 +0000 (-0800) Subject: Fix bug with rate calculation on test page. X-Git-Tag: v2.0.0~33 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=755a478d7f6e7159a22b15b46268e5e33e6db073;p=nano-pow.git Fix bug with rate calculation on test page. --- diff --git a/test.html b/test.html index e11a480..d348c2d 100644 --- a/test.html +++ b/test.html @@ -37,12 +37,12 @@ SPDX-License-Identifier: GPL-3.0-or-later logarithms += Math.log(times[i]) min = Math.min(min, times[i]) max = Math.max(max, times[i]) - if (count > 2 && i > (count * 0.1) && i < (count * 0.9)) truncated += times[i] + if (count < 3 || (i > (count * 0.1) && i < (count * 0.9))) truncated += times[i] } return { count: count, total: sum, - rate: count / truncated * 1000, + rate: 1000 * count / (truncated || sum), min: min, max: max, arithmetic: sum / count,