Skip to content

Releases: apurva313/competitive-math-toolkit

v1.0.4

19 Feb 11:23
Compare
Choose a tag to compare

🚀 Release v1.0.4: Major Enhancements & New Features

This update introduces a range of mathematical utilities, including bitwise operations, divisibility checks, prime factorization, and modular arithmetic functions.

🔥 New Features & Improvements

Bitwise Operations – Added functions for AND, OR, XOR, NOT, left shift, and right shift.
Divisibility Functions – Check divisibility of numbers efficiently.
Prime Factorization – Optimized method for finding prime factors.
isPrime – Enhanced algorithm for primality testing.
Modular Arithmetic – Implemented:

  • modAdd(a, b, m): Computes (a + b) mod m
  • modSubtract(a, b, m): Computes (a - b) mod m
  • modMultiply(a, b, m): Computes (a × b) mod m
  • modInverse(a, m): Computes modular inverse
  • modDivide(a, b, m): Divides two numbers under modulo using modular inverse

Additional Math Functions:

  • nthRoot(n, a): Computes the nth root of a number
  • isPerfectSquare(n): Checks if n is a perfect square
  • isPerfectCube(n): Checks if n is a perfect cube
  • binaryExponentiation(base, exp, m): Fast modular exponentiation
  • nPr(n, r): Computes permutations
  • isCoprime(a, b): Checks if two numbers are coprime
  • sumOfDivisors(n): Computes the sum of divisors of n
  • countPrimes(n): Counts the number of primes up to n

🔧 Bug Fixes & Optimizations

  • Improved performance of isPrime for large numbers.
  • Optimized prime factorization using efficient algorithms.
  • Fixed reference errors in combinatorics module.

📌 Upgrade Now

npm update competitive-math-toolkit

or

npm install competitive-math-toolkit@1.0.4

v1.0.3

16 Feb 06:36
Compare
Choose a tag to compare

🚀 Competitive Math Toolkit v1.0.3 - Improved CRT

🔥 What's New?

  • Optimized Chinese Remainder Theorem calculations
  • Minor bug fixes and improvements

📦 Install:

npm install competitive-math-toolkit@1.0.3

or

npm update competitive-math-toolkit

Full Changelog: https://github.com/apurva313/competitive-math-toolkit/commits/v1.0.3