Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GreatestCommonDivisor ¶
GreatestCommonDivisor is a function that calculates the greatest common divisor (GCD) of two integers using the Euclidean algorithm.
Parameters:
- a, b: The two integers to find the GCD of.
Returns:
- int: The GCD of the two input numbers.
func PrimeFactorization ¶
PrimeFactorization is a function that performs prime factorization on an input number.
Panics with an error of type *ErrInvalidParameter if the input number is 0.
In the resulting map, no prime factor will have a value of 1, except for 1 and -1, which is represented as [1: 1]. Finally, negative numbers are converted to positive numbers.
Parameters:
- inputNumber: The number to factorize.
Returns:
- map[int]int: A map where the keys are the prime factors and the values are their respective powers.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.