Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Sample tests:
when
code_to_voltage(0, 1, 5, 10)
returns0.0048828125
, which seems to be the precise answer.Also, as all values in the process are exact binary fractions, exact comparisons should be used.
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).
The error message is useless when the expected/actual values shown are rounded at a much lower resolution than accepted error range:
double
with actual/expected values compared for approximate equality