pescador_bob (5) [Avatar] Offline
listing 4.1 line 20 reads:

assert (0.0..1.0).contains(0.5)

unfortunately, this assertion fails now (even though it must have when you wrote the book).

a printout

(0.0..1.0).each { num ->
print num + ', '


0.0, 1.0,
pescador_bob (5) [Avatar] Offline
Re: Code error in listing 4.1 (range declarations)
I saw this post on this, not in the errata as I supposed it should be:

but my question then is, how would listing 4.2 then work if the age were something like 36.5

Could you use the switch statement then with containsWithin somehow?