added NaN test for square
added NaN test for square
added doc for square