Como verificar dependências de carros alegóricos

Quero determinar (em c ++) se um número flutuante é o inverso multiplicativo de outro número flutuante. O problema é que eu tenho que usar uma terceira variável para fazer isso. Por exemplo, 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;

saída: "eles não estão ...", o que está errado e 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;

saída: "eles são ...", o que é corret
Por que isso está acontecendo

questionAnswers(10)

yourAnswerToTheQuestion