From 9de64b74ba8200a73ff76dca903ec6f75989afe7 Mon Sep 17 00:00:00 2001 From: routersys Date: Fri, 2 Oct 2026 13:16:44 +0900 Subject: [PATCH] =?UTF-8?q?=E7=84=A1=E9=99=90=E5=A4=A7=E3=81=AB=E3=81=82?= =?UTF-8?q?=E3=81=B5=E3=82=8C=E3=82=8B=E8=A8=B1=E5=AE=B9=E5=80=A4=E3=82=92?= =?UTF-8?q?=E5=8F=97=E3=81=91=E4=BB=98=E3=81=91=E3=81=AA=E3=81=84=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ComputeGuard/ComputeTolerance.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ComputeGuard/ComputeTolerance.cs b/ComputeGuard/ComputeTolerance.cs index dd27282..2984e03 100644 --- a/ComputeGuard/ComputeTolerance.cs +++ b/ComputeGuard/ComputeTolerance.cs @@ -19,6 +19,11 @@ internal readonly record struct ComputeTolerance Ulps = ulps; Scale = scale; FlushedOperations = flushedOperations; + + if (!double.IsFinite(Absolute)) + { + throw new ArgumentOutOfRangeException(nameof(scale)); + } } public static ComputeTolerance Exact => default;