I am using TCP/IP socket programming. I have a floating point value stored in a variable ret_val in my server cod
If you know that both client and server are the same platform etc., you can simply use sizeof(float) to determine your buffer size and copy that many bytes from the address of your float.
float number = 123.45;
send(sockfd, &number, sizeof(float),0);
As soon as your client/server are different platforms/different languages etc. you'll have to start worrying about how to portably encode the float. But for a simple approach, the above will work fine.