Ad
  • Default User Avatar

    Sample tests:

    Expected: "0.005" Actual: "0.005"

    when code_to_voltage(0, 1, 5, 10) returns 0.0048828125, which seems to be the precise answer.
    Also, as all values in the process are exact binary fractions, exact comparisons should be used.

  • Custom User Avatar

    Why rounding to 3 decimal places if the results are compared to 4 decimal places? The rounding is not helping anything here (in fact, it'd make things worse).

  • Custom User Avatar

    The error message is useless when the expected/actual values shown are rounded at a much lower resolution than accepted error range:

    Expected: "0.005" Actual: "0.005"
    
  • Custom User Avatar
    • The output should be a double with actual/expected values compared for approximate equality
    • "Convert a math formula into a program" is not a novel kata idea