> Furthermore, if you want to be very anal, I think the `if` could be wrong

Ahh, I see the concern.  I don't mind trialling the `abs` of the argument; the reason I formulated it like this was so that code coverage analysis would let you see if there was any change in whether the imaginary part was turning out slightly negative or not.

Doesn't the simplest and most correct form you propose potentially fall victim to the same issue you identify with the use of `if`?