The postcondition of the function is that it yields a unit vector, thus the caller expects the result to have length 1. When a zero vector is passed, this is impossible to achieve. Since the expectation cannot be met in any circumstances, the argument passed to unitVector() must be wrong.
So yes, crashing the application is the best way to immediately find the bug. Ignoring it will only let the error propagate and show up later, where it is much more difficult to find. I'm aware that there may be situations where one would really want a zero vector back; but in my opinion these cases are rare and should be handled explicitly by the user. The nice side effect of assert is that no performance is wasted to deal with situations that do not occur in correct code.
Actually,
we're both I'm talking nonsense. These are floating point values, so assuming an IEEE 754 complaint environment, your implementation will simply return infinite in the zero vector case. Sorry to break the bad news.
And I don't think there is any ambiguity concerning where to place the assert. [...]
Well yes, clearly. I didn't mean debug assertions though. Anyway, this hardly seems like the appropriate thread to continue this discussion.
EDIT: It seems that I may have misunderstood your position. Obviously debug assertions should immediately halt the program.