Cómo verificar dependencias de flotadores

Quiero determinar (en c ++) si un número flotante es el inverso multiplicativo de otro número flotante. El problema es que tengo que usar una tercera variable para hacerlo. Por ejemplo este código:

float x=5,y=0.2;
if(x==(1/y)) cout<<"They are the multiplicative inverse of eachother"<<endl;
else cout<<"They are NOT the multiplicative inverse of eachother"<<endl;

will output: "they are not ..." que está mal y este código:

float x=5,y=0.2,z;
z=1/y;
if(x==z) cout<<"They are the multiplicative inverse of eachother"<<endl;
else cout<<"They are NOT the multiplicative inverse of eachother"<<endl;

will output: "they are ...", lo cual es correcto.
¿Por qué está pasando esto

Respuestas a la pregunta(10)

Su respuesta a la pregunta