/**
 * This function takes two numbers as input and finds the intersection of an infinite loop and the division assignment operator.
 *
 * @param num1 The first number.
 * @param num2 The second number.
 * @return A tuple containing the intersection points of the infinite loop and the division assignment operator.
 * @throws IllegalArgumentException If both numbers are zero.
 */
fun findInfiniteLoop(num1: Double, num2: Double): List<Double> {

    if (num1 == 0.0 && num2 == 0.0) {
        throw IllegalArgumentException("Both numbers cannot be zero.")
    }

    val intersections = mutableListOf<Double>()

    var divOp1 = num1
    var divOp2 = num2

    while (true) {
        divOp1 /= num1
        divOp2 /= num2

        if (divOp1 == divOp2) {
            intersections.add(divOp1)
            break
        }
    }

    return intersections
}
/**
 * This function takes two numbers as input and finds the intersection of an infinite loop and the division assignment operator.
 *
 * @param num1 The first number.
 * @param num2 The second number.
 * @return A tuple containing the intersection points of the infinite loop and the division assignment operator.
 * @throws IllegalArgumentException If both numbers are zero.
 */
fun findInfiniteLoop(num1: Double, num2: Double): List<Double> {
/**
 * This function takes two numbers as input and finds the intersection of an infinite loop and the division assignment operator.
 *
 * @param num1 The first number.
 * @param num2 The second number.
 * @return A tuple containing the intersection points of the infinite loop and the division assignment operator.
 * @throws IllegalArgumentException If both numbers are zero.
 */
fun findInfiniteLoop(num1: Double, num2: Double): List<Double> {

    if (num1 == 0.0 && num2 == 0.0) {
        throw IllegalArgumentException("Both numbers cannot be zero.")
    }

    val intersections = mutableListOf<Double>()

    var divOp1 = num1
    var divOp2 = num2

    while (true) {
        divOp1 /= num1
        divOp2 /= num2

        if (divOp1 == divOp2) {
            intersections.add(divOp1)
            break
        }
    }

    return intersections
}