Ad
  • Custom User Avatar

    Remember to handle edge cases like when S is 0.

    Okay, so what should the power factor be when S = 0 then...?


    Returns a list of names of devices with power factors below 0.85

    But the kata tells us to use a sub-function which rounds by 4 decimal places. This means a power factor of 0.84999 will be considered not below 0.85, even though it shouldn't.

    But then, calculate_power_factor is not tested anyway, so why are we rounding in the first place? Is testing P/S < 0.85 so complicated?