MyLogicalLibrary 1.0.0
dotnet add package MyLogicalLibrary --version 1.0.0
NuGet\Install-Package MyLogicalLibrary -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="MyLogicalLibrary" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MyLogicalLibrary --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MyLogicalLibrary, 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 MyLogicalLibrary as a Cake Addin #addin nuget:?package=MyLogicalLibrary&version=1.0.0 // Install MyLogicalLibrary as a Cake Tool #tool nuget:?package=MyLogicalLibrary&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MyLogicalLibrary
MyLogicalLibrary is a C# library that provides a variety of mathematical and string operations. It includes functionalities for arithmetic calculations, number theory, string manipulations, and more.
Features
Math Operations
- Addition:
Add(int a, int b)
- Subtraction:
Subtract(int a, int b)
- Multiplication:
Multiply(int a, int b)
- Division:
Divide(int a, int b)
- Check Prime:
IsPrime(int number)
- Generate Fibonacci:
GenerateFibonacci(int count)
- Factorial:
Factorial(int number)
- Check Even or Odd:
CheckEvenOrOdd(int number)
- Find Largest of Two Numbers:
FindLargestOfTwoNumbers(int num1, int num2)
- Swap Two Numbers:
SwapTwoNumbers(ref int num1, ref int num2)
- Find Sum of Multiples of 3 and 5:
FindSumOfMultiplesOf3And5(int limit)
- Reverse Number:
ReverseNumber(int number)
- Check Palindrome:
ReverseAndCheckPalindrome(int number)
- Convert to Binary:
PrintBinaryEquivalent(int number)
- Multiplication Table:
PrintMultiplicationTable(int number)
String Operations
- Reverse String:
Reverse(string input)
- Check Palindrome:
IsPalindrome(string input)
- Count Alphabets:
CountAlphabets(string input)
- Count Duplicate Characters:
CountDuplicates(string input)
- Check for Duplicate Characters:
HasDuplicateCharacters(string input)
Installation
You can install MyLogicalLibrary via NuGet Package Manager:
Or via .NET CLI:
dotnet add package MyLogicalLibrary
Usage
Here’s a simple example of how to use MyLogicalLibrary:
using MyLogicalLibrary;
var mathOps = new MathOperations();
// Basic arithmetic
int sum = mathOps.Add(5, 3); // 8
int difference = mathOps.Subtract(5, 3); // 2
int product = mathOps.Multiply(5, 3); // 15
double quotient = mathOps.Divide(5, 2); // 2.5
// Check if a number is prime
bool isPrime = mathOps.IsPrime(7); // true
// Generate Fibonacci series
var fibonacciSeries = mathOps.GenerateFibonacci(10); // {0, 1, 1, 2, 3, 5, 8, 13, 21, 34}
// Calculate factorial
long factorial = mathOps.Factorial(5); // 120
MathOperations Class
Add(int a, int b): Returns the sum of two integers.
Subtract(int a, int b): Returns the difference of two integers.
Multiply(int a, int b): Returns the product of two integers.
Divide(int a, int b): Returns the quotient of two integers.
IsPrime(int number): Checks if a number is prime.
GenerateFibonacci(int count): Generates a Fibonacci series of a specified count.
Factorial(int number): Calculates the factorial of a number.
CheckEvenOrOdd(int number): Checks if a number is even or odd.
PrintOddNumbersInRange(int start, int end): Returns odd numbers in a specified range.
CheckPositiveOrNot(int number): Checks if a number is positive, negative, or zero.
FindLargestOfTwoNumbers(int num1, int num2): Finds the largest of two numbers.
SwapTwoNumbers(ref int num1, ref int num2): Swaps two numbers.
CheckDivisibleByTwo(int number): Checks if a number is divisible by 2.
FindSumOfMultiplesOf3And5(int limit): Calculates the sum of multiples of 3 and 5 below a given limit.
PrintMultiplesOf17(int limit): Returns multiples of 17 below a specified limit.
FindSumOfDigits(int number): Finds the sum of the digits of a number.
FindSumOfDigitsUsingRecursion(int number): Finds the sum of the digits of a number using recursion.
ReverseNumber(int number): Reverses the digits of a number.
ReverseAndCheckPalindrome(int number): Checks if a number is a palindrome by reversing it.
SumOfTwoBinaryNumbers(string binary1, string binary2): Sums two binary numbers.
MultiplyTwoBinaryNumbers(string binary1, string binary2): Multiplies two binary numbers.
using MyLogicalLibrary;
var stringOps = new StringOperations();
// Reverse a string
string reversed = stringOps.Reverse("Hello"); // "olleH"
// Check if a string is a palindrome
bool isPalindrome = stringOps.IsPalindrome("racecar"); // true
// Count the number of alphabets in a string
int alphabetCount = stringOps.CountAlphabets("Hello World!"); // 10
// Count duplicate characters
var duplicates = stringOps.CountDuplicates("Hello World!"); // { 'l': 3, 'o': 2 }
// Check for duplicate characters
bool hasDuplicates = stringOps.HasDuplicateCharacters("Hello"); // true
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.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 | 78 | 11/15/2024 |