From 99cf3c5a2ea871e22c3fb47702ce0760f57185d7 Mon Sep 17 00:00:00 2001 From: routersys Date: Fri, 2 Oct 2026 13:16:45 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=82=E3=81=B5=E3=82=8C=E3=82=8B=E8=A8=B1?= =?UTF-8?q?=E5=AE=B9=E5=80=A4=E3=82=92=E6=8B=92=E3=82=80=E8=A9=A6=E9=A8=93?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ComputeGuard.Tests/ComputeToleranceTests.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ComputeGuard.Tests/ComputeToleranceTests.cs b/ComputeGuard.Tests/ComputeToleranceTests.cs index 3e30660..baa4c59 100644 --- a/ComputeGuard.Tests/ComputeToleranceTests.cs +++ b/ComputeGuard.Tests/ComputeToleranceTests.cs @@ -55,4 +55,22 @@ public sealed class ComputeToleranceTests Assert.Throws(create); } + + [Fact] + public void AToleranceThatOverflowsIsRejected() + { + Action create = () => _ = new ComputeTolerance(1e300, 1e300, 0); + + Assert.Throws(create); + } + + [Fact] + public void ALargeButFiniteToleranceIsAccepted() + { + var tolerance = new ComputeTolerance(1d, 1e300, 0); + + var absolute = tolerance.Absolute; + + Assert.True(double.IsFinite(absolute)); + } }