/**
 * Calculate the resistance of an electrical circuit using the Ternary Operator.
 *
 * @param voltage The voltage across the circuit in volts.
 * @param current The current passing through the circuit in amperes.
 * @return The calculated resistance of the circuit in ohms.
 */
fun calculateResistance(voltage: Double, current: Double): Double {

    // Use the Ternary Operator to calculate the resistance
    val resistance = if (current != 0.0) voltage / current else Double.POSITIVE_INFINITY
    return resistance
}

// -----------------
// Example Usage
// -----------------
/**
 * Calculate the resistance of an electrical circuit using the Ternary Operator.
 *
 * @param voltage The voltage across the circuit in volts.
 * @param current The current passing through the circuit in amperes.
 * @return The calculated resistance of the circuit in ohms.
 */
fun calculateResistance(voltage: Double, current: Double): Double {
/**
 * Calculate the resistance of an electrical circuit using the Ternary Operator.
 *
 * @param voltage The voltage across the circuit in volts.
 * @param current The current passing through the circuit in amperes.
 * @return The calculated resistance of the circuit in ohms.
 */
fun calculateResistance(voltage: Double, current: Double): Double {

    // Use the Ternary Operator to calculate the resistance
    val resistance = if (current != 0.0) voltage / current else Double.POSITIVE_INFINITY
    return resistance
}

// -----------------
// Example Usage
// -----------------