fix a bug of sqrt(0)