well i found the ans wer nd its not wht u all r saying .....floats or doubles can be compared using >= etc the ans lies in the internal representation of floats and doubles

float is represented using IEEE 754 single precision

double by IEEE 754 double precision so .7>.7f and so on.....thnx newayz

Can't was probably the wrong word to use you can use all the comparison operators on doubles and floats

==

!=

>

<

>=

<=

However using == and != is virtually pointless as after any calculations have been performed it is unlikely that any 2 given floats will that approximate the same value will actually have the same value so typically == will always return false and != will always return true making them fairly useless.

Using > < >= and <= is OK as long as you when you do so you are fully aware that if you test <0.7 if you variable has the value 0.700000000000001 than the test will return false.

I hope you realise that "IEEE 754 single precision double by IEEE 754 double precision so .7>.7f " does not mean that for every approximation of a given number in single and double precision then the double precision representation is bigger than the single precision representation, that is

x > xf

is not true for all x