Calculate square of a number (#829)