6hundred9.MathLib
1.0.0
dotnet add package 6hundred9.MathLib --version 1.0.0
NuGet\Install-Package 6hundred9.MathLib -Version 1.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="6hundred9.MathLib" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add 6hundred9.MathLib --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: 6hundred9.MathLib, 1.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 6hundred9.MathLib as a Cake Addin #addin nuget:?package=6hundred9.MathLib&version=1.0.0 // Install 6hundred9.MathLib as a Cake Tool #tool nuget:?package=6hundred9.MathLib&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ABOUT
MathLib is a .NET 8.0 library for mathematical methods for your use!
HOW TO USE
There is a tests file that has an example/use for every method, I'll just put the code here for now:
using System;
using System.Collections.Generic;
using System.Text;
namespace MathLib;
public class Tests
{
/// <summary>
/// Uses a hardcoded value to test the FibonacciSequence method
/// </summary>
public static void FibonacciSeq()
{
List<long> a = MathLib.Main.FibonacciSequence(70);
Console.WriteLine($"Number A: {a[0]}\nNumber B: {a[1]}");
}
/// <summary>
/// Uses a hardcoded value to test the CalculatePhi method
/// </summary>
public static void Phi()
{
decimal m = Math.Round(MathLib.Main.CalculatePhi(70), 28, MidpointRounding.ToEven); // Round is messing with value pls fix :pray:
Console.WriteLine($"Calculated Phi: {m}");
Console.WriteLine($"Actual Phi: 1.6180339887498948482045868343");
Console.WriteLine($"Difference: {m - 1.6180339887498948482045868343m}");
}
/// <summary>
/// Uses hardcoded values to test the GreatestCommonDivider method
/// </summary>
public static void GCD()
{
Console.WriteLine($"GCD: {Main.GreatestCommonDivider(128, 96)}");
}
/// <summary>
/// Uses hardcoded values to test the TrapezoidalRule method
/// </summary>
public static void Trapezoidal()
{
Console.WriteLine($"The integral is approximately: {Main.TrapezoidalRule(x => x * x, 0, 1, 1000)}");
}
/// <summary>
/// Uses a hardcoded value to test the SieveOfEratosthenes method
/// </summary>
public static void SieveOfEratosthenes()
{
StringBuilder sb = new();
sb.Append("Sieve of Eratosthenes: ");
foreach (var value in Main.SieveOfEratosthenes(5000))
{
sb.Append($"{value}, ");
}
Console.WriteLine(sb);
}
/// <summary>
/// Use a hardcoded value to test CalculateMaxValueForDifferentBytes method to get the largest 64-bit signed integer
/// </summary>
public static void CalcBytes()
{
Console.WriteLine($" Signed 64: {Main.CalculateMaxValueForDifferentBytes(64)}\n" +
$"Unsigned 64: {Main.CalculateMaxValueForDifferentBytes(64, false)}");
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.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 |
---|---|---|
1.0.0 | 101 | 7/18/2024 |