Thanks everyone for the responses. One thing I was wondering was whether this kind of error can happen at all, since all the examples I've seen use health as though it's an exact value and they seem to work fine. I don't know anything about how Haxe handles floats internally, so for all I know it's entirely possible that the regular float checking in the hurt() function works as expected, and the codebook is just wrong or at least misleading.
Probably best to play it safe. So anyway, these are all good suggestions. I'll probably do what dean suggested and override hurt().