Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
improved answer
Source Link

IfPointing value saved in variable and constant have not same data types. It's the difference in the precision of data types. If you change the datatype of f variable to double, it'll print equal, This is because constants in floating point-point stored in double and non floating-floating in long by default, doubledouble's precision is high and float has less precise, double value stored in 64 bit binary andhigher than float value stored in 32 bit binary,. it'll be completely clear if you see the method of floating point-point numbers conversion to binary conversion.conversion

If you change datatype of f to double, it'll print equal, This is because constants in floating point stored in double and non floating in long, double precision is high and float has less precise, double value stored in 64 bit binary and float value stored in 32 bit binary, it'll be completely clear if you see the method of floating point numbers conversion to binary conversion.

Pointing value saved in variable and constant have not same data types. It's the difference in the precision of data types. If you change the datatype of f variable to double, it'll print equal, This is because constants in floating-point stored in double and non-floating in long by default, double's precision is higher than float. it'll be completely clear if you see the method of floating-point numbers conversion to binary conversion

Source Link

If you change datatype of f to double, it'll print equal, This is because constants in floating point stored in double and non floating in long, double precision is high and float has less precise, double value stored in 64 bit binary and float value stored in 32 bit binary, it'll be completely clear if you see the method of floating point numbers conversion to binary conversion.