diff --git a/QuadrupleLib.Tests/Math/LogarithmTests.cs b/QuadrupleLib.Tests/Math/LogarithmTests.cs index b54d14d..5f4235a 100644 --- a/QuadrupleLib.Tests/Math/LogarithmTests.cs +++ b/QuadrupleLib.Tests/Math/LogarithmTests.cs @@ -25,6 +25,20 @@ namespace QuadrupleLib.Tests.Math public abstract class LogarithmTests where TAccelerator : IAccelerator { + [Theory] + [InlineData(-0.288)] + [InlineData(0.5)] + [InlineData(2.0)] + [InlineData(-2.0)] + [InlineData(-4.65)] + public void IsILogBCorrect(double x) + { + double y = double.Exp2(x); + + int n = (int)System.Math.Floor(x); + Assert.Equal(n, Float128.ILogB(y)); + } + [Theory] [InlineData(-0.288)] [InlineData(0.5)] diff --git a/QuadrupleLib.Tests/Math/TrigonometryTests.cs b/QuadrupleLib.Tests/Math/TrigonometryTests.cs index 323dab6..4dcabba 100644 --- a/QuadrupleLib.Tests/Math/TrigonometryTests.cs +++ b/QuadrupleLib.Tests/Math/TrigonometryTests.cs @@ -693,6 +693,17 @@ public void IsAtan2EqualCoRDiC(double thetaDeg) Float128 thetaB = Float128.Atan2(sin, cos); AssertX.NearlyEqual(thetaA, thetaB, Precision.NearestTenThousandth); } + + [Theory] + [InlineData(3.0, 4.0)] + [InlineData(1.5, 2.0)] + [InlineData(1.0, 1.0)] + [InlineData(5.6, 7.125)] + public void IsHypotCorrect(double a, double b) + { + double c = double.Hypot(a, b); + AssertX.NearlyEqual(c, Float128.Hypot(a, b), Precision.NearestTenThousandth); + } } public class TrigonometryTests_DefaultAccelerator : diff --git a/QuadrupleLib.Tests/Utilities/AcceleratorTests.cs b/QuadrupleLib.Tests/Utilities/AcceleratorTests.cs index cda152c..a6c74d8 100644 --- a/QuadrupleLib.Tests/Utilities/AcceleratorTests.cs +++ b/QuadrupleLib.Tests/Utilities/AcceleratorTests.cs @@ -1,4 +1,22 @@ -using QuadrupleLib.Accelerators; +/* + * Copyright 2026 Chosen Few Software + * This file is part of QuadrupleLib. + * + * QuadrupleLib is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * QuadrupleLib is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with QuadrupleLib. If not, see . + */ + +using QuadrupleLib.Accelerators; using Xunit; namespace QuadrupleLib.Tests.Utilities