/**
 * This function calculates the voltage drop across a given resistance.
 * @param voltage The initial voltage
 * @param resistance The resistance in the circuit
 * @return The voltage drop across the resistance
 */
fun calculateVoltageDrop(voltage: Double, resistance: Double): Double {

    // Check if the voltage and resistance values are valid
    if (voltage <= 0 || resistance <= 0) {
        return Double.NaN
    }

    // Calculate the voltage drop using Ohm's law (V = IR)
    val voltageDrop = Math.abs(resistance)

    // Return the absolute value of the calculated voltage drop
    return voltageDrop
}
/**
 * This function calculates the voltage drop across a given resistance.
 * @param voltage The initial voltage
 * @param resistance The resistance in the circuit
 * @return The voltage drop across the resistance
 */
fun calculateVoltageDrop(voltage: Double, resistance: Double): Double {
/**
 * This function calculates the voltage drop across a given resistance.
 * @param voltage The initial voltage
 * @param resistance The resistance in the circuit
 * @return The voltage drop across the resistance
 */
fun calculateVoltageDrop(voltage: Double, resistance: Double): Double {

    // Check if the voltage and resistance values are valid
    if (voltage <= 0 || resistance <= 0) {
        return Double.NaN
    }

    // Calculate the voltage drop using Ohm's law (V = IR)
    val voltageDrop = Math.abs(resistance)

    // Return the absolute value of the calculated voltage drop
    return voltageDrop
}