S
Shoban Jayaraj
Hi,
I have the following code:
#include <stdio.h>
int main(int argc, char **argv)
{
double d = 1.0e100;
float f = 1.0e100;
float f1 = d;
printf("%6.4f\n", static_cast<float>(d));
printf("%6.4f\n", (float)(d));
printf("%6.4f\n", f);
printf("%6.4f\n", f1);
return 0;
}
that prints
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000
1.#INF
1.#INF
My assumption is, as I am casting the doubles to float, it should als
print 1.#INF, but not so. Why?
Thanks in advance,
Shoban Jayaraj
I have the following code:
#include <stdio.h>
int main(int argc, char **argv)
{
double d = 1.0e100;
float f = 1.0e100;
float f1 = d;
printf("%6.4f\n", static_cast<float>(d));
printf("%6.4f\n", (float)(d));
printf("%6.4f\n", f);
printf("%6.4f\n", f1);
return 0;
}
that prints
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000
1.#INF
1.#INF
My assumption is, as I am casting the doubles to float, it should als
print 1.#INF, but not so. Why?
Thanks in advance,
Shoban Jayaraj