udacity / sdc-issue-reports

29 stars 6 forks source link

Term 2, Lesson 5, Part 19 - Checker does not accept "-0" #1439

Closed megaserg closed 5 years ago

megaserg commented 5 years ago

Checker did not accept this output:

Hj:
0.447214 0.894427        0        0
    -0.4      0.2        0        0
      -0        0 0.447214 0.894427
mvirgo commented 5 years ago

Not sure exactly what the value is at [2][0] but there should not be any negative, however small, there.

megaserg commented 5 years ago

Unfortunately I wasn't able to recover the code that produced this, but it was semantically the same expression as in the provided solution, perhaps computed in a different sequence that gave way to rounding error.

mvirgo commented 5 years ago

No worries! Since that specific value is py*(vx*py - vy*px)/c3, along with px = 1, py = 2, vx = 0.2, vy = 0.4, the amount within the parentheses is (0.22 - 10.4) = (0.4 - 0.4) = 0, so in this situation we know anything multiplied by zero (i.e. py*0) is going to be exactly zero.