Meow.Math.Fraction
2.0.0
dotnet add package Meow.Math.Fraction --version 2.0.0
NuGet\Install-Package Meow.Math.Fraction -Version 2.0.0
<PackageReference Include="Meow.Math.Fraction" Version="2.0.0" />
paket add Meow.Math.Fraction --version 2.0.0
#r "nuget: Meow.Math.Fraction, 2.0.0"
// Install Meow.Math.Fraction as a Cake Addin #addin nuget:?package=Meow.Math.Fraction&version=2.0.0 // Install Meow.Math.Fraction as a Cake Tool #tool nuget:?package=Meow.Math.Fraction&version=2.0.0
Meow.Math.Fraction
<img src="https://img.shields.io/nuget/vpre/Meow.Math.Fraction?label=NuGet%20Version" alt="nugetVersion"/> <img src="https://img.shields.io/nuget/dt/Meow.Math.Fraction?label=Nuget%20Download" alt="nugetDownload"/>
Intro
this is a repo that use 2 BigInteger that represent a fraction
when calculate it manipulate on BigInteger (thus numerator/denominator) when transcribe out, it calculate and output the number.
it use a
heap allocation
represent a number, as if ensure a number is not truncate by IEEE standard.
Struct
public readonly struct Fraction
{
private readonly BigInteger num;
private readonly BigInteger den;
}
Manipulation / Calculation
Fraction a = 1;
a /= 3;
Features
it auto (implicit) convert the type of any
Integer Type
intoFraction
it auto (implicit) convert the type of any
Double Type
intoFraction
but
Double
Type only record the first15 digit
(valid) whichmay
cause issues.
Mode
- it always keep the number in fraction mode
which is percise
. - when calculate the number
still in percise mode
, which do as numerator and denominator. - when
print
it intonone percise mode
, it will calculate into specific digit.
Operators
[operator]
{var} >> {int}
, this operator let you get percise digit number of a fraction.[operator]
! {var}
, this operator simplify the fraction.[operator]
~ {var}
, this operator try turning the fraction into a complex fraction.
Fraction a = 52163;
a /= 16604;
Console.WriteLine(a >> 20); // (3, 14159238737653577451)
Console.WriteLine(a >> 50); // (3, 14159238737653577451216574319441098530474584437484)
Console.WriteLine(~a); // (3, 2351 / 16604)
Console.WriteLine(!a); // 52163 / 16604
Tricks
- when add into Fraction mode. in the VS, the operator will change color. hover the operator to see if it's correct.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.0 | 169 | 10/9/2023 |
downgrade into .netstandard 2