)bool is_negative(float x) {

Accessing codice_21 after initializing the other member, codice_22, is still a form of type-punning in C and the result is unspecified behavior (and undefined behavior in C++ ).