Implemented some math functions in socket programming.