operators refactoring
.NET Test / .NET tests (push) Successful in 2m11s

This commit is contained in:
2026-09-24 00:39:59 +04:00
parent 3de9457fdc
commit ac93744579
26 changed files with 651 additions and 334 deletions
@@ -16,7 +16,7 @@ public class PreciseMathExpTests
// Inputs are exact stored binary64 sums, not rounded irrational constants.
DoubleDouble input = DoubleDouble.FromComponents(high, low);
(Units(input.High) + Units(input.Low)).ShouldBe(Units(high) + Units(low));
DoubleDouble actual = DDMath.Exp(input);
DoubleDouble actual = DoubleDouble.Exp(input);
DoubleDouble.IsCanonical(actual).ShouldBeTrue();
if (overflow)
{
@@ -60,7 +60,7 @@ public class PreciseMathExpTests
{
// Independently round Decimal.exp(exact binary64 input)/2^-1074 to an
// integer at 180 digits. Pin more than the general one-subnormal bound.
DoubleDouble actual = DDMath.Exp(new DoubleDouble(input));
DoubleDouble actual = DoubleDouble.Exp(new DoubleDouble(input));
BitConverter.DoubleToInt64Bits(actual.High).ShouldBe(expectedBits);
BitConverter.DoubleToInt64Bits(actual.Low).ShouldBe(0L);
}
@@ -70,7 +70,7 @@ public class PreciseMathExpTests
[InlineData(709.781)]
public void LegacyFiniteResultsDoNotOverflowPrematurely(double input)
{
DoubleDouble actual = DDMath.Exp(new DoubleDouble(input));
DoubleDouble actual = DoubleDouble.Exp(new DoubleDouble(input));
DoubleDouble.IsFinite(actual).ShouldBeTrue();
actual.Low.ShouldNotBe(0.0);
// Component-aware accuracy for these exact inputs is pinned by ReferenceCases.
@@ -83,7 +83,7 @@ public class PreciseMathExpTests
double.MaxValue, double.MinValue];
foreach (double input in inputs)
{
DoubleDouble actual = DDMath.Exp(new DoubleDouble(input));
DoubleDouble actual = DoubleDouble.Exp(new DoubleDouble(input));
double expected = Math.Exp(input);
BitConverter.DoubleToInt64Bits(actual.High).ShouldBe(
BitConverter.DoubleToInt64Bits(double.IsNaN(expected) ? double.NaN : expected));