- Fixes #93: DecimalNotationFormatter throws FormatException for some custom formats (via Pull-Request) by lipchev
- Fixes #92: Mark the MathExt exensions as obsolete (reported by lipchev)
- Fixes Fraction.Sqrt(): When the root was calculated from a fraction with a very large numerator and denominator the result could have exceeded double's number range and returned NaN.
- Improving the performance of the Sqrt extension method #88 by lipchev
- DecimalNotationFormatter: extracted a non-boxing Format overload #89 by lipchev
- Added two JSON serializes: StringFractionJsonConverter and StructuralFractionJsonConverter
- Fixes when TryParse was called with a CultureInfo that has a single symbol for infinity/NaN.
- Code / Build cleanups by Marko Lahma:
- PackageLicenseExpression will show up correctly on nuget.org and tools can analyze it
- moving common properties to shared Directory.Build.props for easier maintenance
- Add ContinuousIntegrationBuild to build setup
- Fixes #85 (by Marko Lahma)
- Bugfix in
Fraction.FromDoubleRounded
#83
- Bugfix in
Fraction.CompareTo
#78 by lipchev - Performance optimization in
Fraction.FromDoubleRounded
#80 by lipchev Changed behavior:ArgumentOutOfRangeException
is thrown when argumentsignificantDigits
is < 1 or > 17.
- Fixed nullable issue in Fraction.TryParse(..) reported in #76 Error (active) CS8604 Possible null reference argument for parameter 'value' in 'bool Fraction.TryParse(..)
- Added support for NaN and Infinity by lipchev
- New properties IsNaN, IsInfinity, IsPositiveInfinity, IsNegativeInfinity by lipchev
- Adding a debugger display proxy by lipchev
- Various methods were optimized by lipchev
- Use the potential of Span<T> where sensible and possible (TryParse, FromDecimal) by lipchev
- No longer reduce non-normalized fractions when used in mathematical operations - by lipchev
- Mathematical operations no longer automatically generate normalized fractions if one of the operands is an non-normalized fraction. This has an impact on your calculations, especially if you have used the
JsonFractionConverter
with default settings. In such cases, deserialized fractions create non-normalized fractions, which can lead to changed behavior when callingToString
. Please refer the README section Working with non-normalized fractions - The default behavior of the
.Equals(Fraction)
method has changed:Equals
now compares the calculated value from the numerator/denominator (1/2 = 2/4). - The standard function
ToString()
now depends on the active culture (CultureInfo.CurrentCulture
). The reason is that NaN and Infinity should be displayed in the system language or the corresponding symbol should be used. - Argument name for
Fraction.TryParse(..)
changed fromfractionString
tovalue
. - A fraction of 0/0 no longer has the value 0, but means NaN (not a number). Any fraction in the form x/0 is no longer a valid number. A denominator with the value 0 corresponds to, depending on the numerator, NaN, PositiveInfinity or NegativeInfinity.
- Added hotfix FromString supporting all NumberStyles https://github.com/lipchev
- Added DecimalNotationFormatter + documentation by lipchev
- Added Benchmark results summary (with Readme) by lipchev
- Introduced the negation (-) operator by lipchev
- Added extended xml comments to the FromDouble* methods by lipchev
- Replace .Invert() with .Negate() method
- Incorrect result when rounding 1/3 with MidpointRounding.ToEven (fixes #39) by lipchev
- Added method overload for FromDouble with significant digits by lipchev
- Performance optimization of the FromDouble method by lipchev
- Added benchmarks for the most common operations by lipchev
- Added Fraction.Round/RoundToBigInteger functions by lipchev
- Make the operator from decimal implicit by lipchev
- Support for parsing long/very precise numbers by lipchev
- Added support for
ReadOnlySpan<char>
when using TryParse(..) - Added target framework .NET8.0
- Updated documentation
- Many thanks to @lipchev for the contributions
- The CLSCompliant(true) attribute was added by lipchev
- fix invalid characters in test names by lipchev
- Updated nuget packages
- New Reciprocal() method contributed by https://github.com/teemka
- Updated nuget packages
- Updated Newtonsoft.Json to version 13.0.2 (Dependabot)
- Removed System.Runtime.Numerics dependency. Thanks to @stan-sz #18
- New Sqrt() extension method contributed by https://github.com/MadsKirkFoged
- Removed unsupported framework DLL netstandard1.1 (Issue #9)
- Removed deplicated and unecessary framework DLLs net45, net48, net5.0 and netcoreapp3.1 (Issue #9)
- Breaking change:
new Fraction(0, 0).ToString()
ornew Fraction(0, 3).ToString()
returns "0" instead of "0/0" - Bugfix:
Fraction.Zero.ToString("m")
does not longer throw a divide by zero exception (Issue #6) - Added new framework DLLs for net48, netstandard2.1, netcoreapp3.1 and net5.0