which is the number of bits in a float variable
No, it is not integer, so you cannot calculate it that way. It have floating point (not in fixed place).

It is stored as

1.significand x 2 ^ exponent.

It takes one bit for sign (+/-), 23 for significand (0 is not stored it is implicit) and 8 more for exponent.

Because of this, you have fixed precision (number of significant digits) for very large numbers and also for numbers which are close to zero.

You have it all explained here:
https://en.wikipedia.org/wiki/Single-precision_floating-point_format