diff --git a/mpir.net/mpir.net-tests/HugeFloatTests/Arithmetic.cs b/mpir.net/mpir.net-tests/HugeFloatTests/Arithmetic.cs index 730ef81c..ec6abbe5 100644 --- a/mpir.net/mpir.net-tests/HugeFloatTests/Arithmetic.cs +++ b/mpir.net/mpir.net-tests/HugeFloatTests/Arithmetic.cs @@ -65,6 +65,18 @@ namespace MPIR.Tests.HugeFloatTests [TestClass] public class Arithmetic { + [ClassInitialize] + public static void Setup(TestContext context) + { + HugeFloat.DefaultPrecision = 128; + } + + [ClassCleanup] + public static void Cleanup() + { + HugeFloat.DefaultPrecision = 64; + } + #region Add [TestMethod] diff --git a/mpir.net/mpir.net-tests/HugeFloatTests/Assignment.cs b/mpir.net/mpir.net-tests/HugeFloatTests/Assignment.cs index 265756c2..ce7f8627 100644 --- a/mpir.net/mpir.net-tests/HugeFloatTests/Assignment.cs +++ b/mpir.net/mpir.net-tests/HugeFloatTests/Assignment.cs @@ -107,7 +107,7 @@ namespace MPIR.Tests.HugeFloatTests using (var b = new HugeFloat()) { b.SetTo(a); - FloatAssert.AreEqual(".3333333333333333333333333333333333333333333333333333333333", b); + FloatAssert.AreEqual(".33333333333333333333333333333333333333333333333333333333333333333333333333333333333", b); } } //more tests coming here diff --git a/mpir.net/mpir.net-tests/HugeFloatTests/ConstructionAndDisposal.cs b/mpir.net/mpir.net-tests/HugeFloatTests/ConstructionAndDisposal.cs index 004258d3..9e02c50e 100644 --- a/mpir.net/mpir.net-tests/HugeFloatTests/ConstructionAndDisposal.cs +++ b/mpir.net/mpir.net-tests/HugeFloatTests/ConstructionAndDisposal.cs @@ -25,6 +25,18 @@ namespace MPIR.Tests.HugeFloatTests [TestClass] public class ConstructionAndDisposal { + [TestInitialize] + public void Setup() + { + HugeFloat.DefaultPrecision = 128; + } + + [TestCleanup] + public void Cleanup() + { + HugeFloat.DefaultPrecision = 64; + } + [TestMethod] public void FloatDefaultConstructor() { diff --git a/mpir.net/mpir.net-tests/HugeFloatTests/Conversions.cs b/mpir.net/mpir.net-tests/HugeFloatTests/Conversions.cs index 0730f6b3..2f616ff0 100644 --- a/mpir.net/mpir.net-tests/HugeFloatTests/Conversions.cs +++ b/mpir.net/mpir.net-tests/HugeFloatTests/Conversions.cs @@ -32,6 +32,13 @@ namespace MPIR.Tests.HugeFloatTests public static void Init(TestContext context) { AlmostOne = new HugeFloat(0.99999); + HugeFloat.DefaultPrecision = 128; + } + + [ClassCleanup] + public static void Cleanup() + { + HugeFloat.DefaultPrecision = 64; } [TestMethod] @@ -204,7 +211,7 @@ namespace MPIR.Tests.HugeFloatTests n = "-98ABCDEF876529834765234123984761"; a.SetTo(n, 16); - Assert.AreEqual("-0." + n.Substring(1) + "@" + (n.Length - 1), a.ToString(16)); + Assert.AreEqual("-0." + n.Substring(1) + "@" + (n.Length - 1).ToString("x"), a.ToString(16)); } }