+6

Are Float and int values are equal?

Float y=3.0 and Int x=3 are equal or not? in c++ eual then how?

c++

6/16/2019 2:51:04 PM

imtiaz Ahmad

7 Answers

New Answer

+5

Should be able to compare with the == operator. Quick google search shows the int is converted to floating point, meaning that the numbers may not be perfectly equal when comparing them, but typically are.

+9

https://www.sololearn.com/Discuss/1846914/?ref=app

+4

You can test it using ==

+3

already deleted it was a mistake

+2

No it's not in c++

+2

one can say thats equal but not equal by general due to floating decimal values also in casting problems they are different

0

Thanks all for valuable answers 👍