-
Notifications
You must be signed in to change notification settings - Fork 4
AlgebraicUtils
Aram edited this page May 4, 2025
·
3 revisions
The AlgebraicUtils class provides a variety of methods for algebraic and combinatorial calculations. This utility class includes methods to solve quadratic equations, calculate factorials, compute the greatest common divisor, and generate power sets.
-
solveQuadraticEquation(double, double, double)
Solves a quadratic equation using the quadratic formula.double[] roots = AlgebraicUtils.solveQuadraticEquation(1, -3, 2);
-
factorial(int)
Calculates the factorial of a non-negative integer.long factorial = AlgebraicUtils.factorial(5);
-
calculateGCD(int, int)
Computes the greatest common divisor (GCD) of two integers using the Euclidean algorithm.int gcd = AlgebraicUtils.calculateGCD(54, 24);
-
generatePowerSet(Set)
Generates the power set (all subsets) of a given set.Set<String> set = new HashSet<>(List.of("a", "b", "c")); List<Set<String>> powerSet = AlgebraicUtils.generatePowerSet(set);
- Error Handling: If an input is invalid (e.g., a negative integer for factorial), the method throws an appropriate exception and logs an error message.
- Utility Design: This class cannot be instantiated, as it contains a private constructor and only static methods.
Variant Loader
Data Pipeline
Network & Packets
Logging
Markdown
Utility Classes
- Conversion
- Math
- Minecraft
- Schedular