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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Meow.Math.Fraction" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Meow.Math.Fraction --version 2.0.0                
#r "nuget: Meow.Math.Fraction, 2.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

  1. it auto (implicit) convert the type of any Integer Type into Fraction

  2. it auto (implicit) convert the type of any Double Type into Fraction

but Double Type only record the first 15 digit (valid) which may 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 into none percise mode, it will calculate into specific digit.

Operators

  1. [operator] {var} >> {int}, this operator let you get percise digit number of a fraction.
  2. [operator] ! {var} , this operator simplify the fraction.
  3. [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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .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 163 10/9/2023

downgrade into .netstandard 2