svtk / AtomicKotlinCourse

87 stars 21 forks source link

Ambiguity in the instructions for Summary 1 Exercise 4 #25

Closed joelneely closed 3 years ago

joelneely commented 3 years ago

The instructions for this exercise conclude with the direction:

Make testDouble2() display the result of comparing Double.MAX_VALUE and Double.MAX_VALUE + 1.

but the verb "comparing" seems ambiguous, as there are multiple relational operators that "compare" values. I was not at all clear whether the output should be some indication of their relationship (e.g. "less"/"greater"/"equal"), should be the boolean result of a specific relational test, should be e.g. the maximum of the two, etc.

Based on my experience with floating-point computation, I guessed blindly that this might be looking for the (non-intuitive for beginners) fact that 1 is below the threshold of significance compared to Double.MAX_VALUE and therefore adding 1 to Double.MAX_VALUE yields the same value. But that was drawing on experience I wouldn't expect of a beginner. So, I actually felt that I succeeded by lucky guess because the expectation wasn't clear to me.

I'd recommend adding the phrase "...for equality" or something even more explanatory at the end of that direction.

svtk commented 3 years ago

Thank you for your feedback! I've adjusted the wording (https://github.com/svtk/AtomicKotlinCourse/commit/2ca2af5f992ab6891d1fd3f567fa233b47509ca8).