Float comparison fix#2

Fixed all float comparisons + changed pow(x,2) to x*x.