Rationals 1.3.3

Implementation of rational number arithmetic for .NET with arbitrary precision.

Supported features:

- implicit conversions - rationals integrate seamlessly with other number types
- unlimited precision - rationals use BigInteger inside
- canonical form - each rational can have its canonical form (irreducible fraction where denominator is always positive)
- separate whole and fractional part - any rational number can be separated into a whole part (integer quotient aka result of integer division) and fractional part (reminder of the integral division aka result of modulo operation)
- comparison & equality
- multiple formatting options - ToString("C") (canonical form), ToString("W") (whole + fractional part), or normal fraction format
- continued fraction expansion - expand rational numbers to continued fraction (sequence of coefficients), construct rational numbers from sequence of continued fraction coefficients
- rational number approximation - approximate floating point numbers (decimal, double, float) as rational numbers with customizable tolerance

Example usage:

Rational left = (Rational) 1 / 2;

Rational right = (Rational) 1 / 4;

Rational sum = left + right; // equals to: 3 / 4

Install-Package Rationals -Version 1.3.3
dotnet add package Rationals --version 1.3.3
<PackageReference Include="Rationals" Version="1.3.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rationals --version 1.3.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

https://github.com/tompazourek/Rationals/releases

  • .NETFramework 4.6

    • No dependencies.
  • .NETFramework 4.7

    • No dependencies.
  • .NETStandard 1.4

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Rationals:

Package Downloads
CryptoExchangeClient
Clients for multiple cryptocurrency exchanges. All clients have a shared interface for common actions.
DelSquared.Radicals
.NET implementation of radical expressions enabling radical expression arithmetic.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.3.3 4,360 1/15/2019
1.3.2 9,153 9/15/2018
1.3.1 16,403 11/18/2017
1.3.0 728 11/11/2017
1.2.1 867 3/11/2017
1.2.0 2,417 7/2/2016
1.1.1 567 7/2/2016
1.1.0 558 7/2/2016
1.0.0 1,037 11/1/2014