J
jameskuyper
Chip said:Is 3.0f required to be equal to (float)3.0 ?
No, and in general it won't be true. Try this:
#include <stdio.h>
int main(int argc, char *argv[])
{
float f = 0.1f;
double d = 0.1;
if (f == d)
That doesn't correspond to his question. Try the following instead:
if (f == (float)d)
I think you'll find that it works much better (though it's still not
guaranteed to work).,