>Why does it work with sqrt(-1), and not with dividing by 0 ?
Good question!
It does work with dividing by zero :D
See: https://en.wikipedia.org/wiki/Riemann_sphere