1.23e+02和1.23e02有区别吗
如题 你试一试就知道了$ cat main.c
#include <stdio.h>
void output(void *data, size_t size) {
for(size_t i = 0; i < size; ++i) {
printf("%.2x ", ((unsigned char *)data));
}
puts("");
}
int main(void) {
{
double a = 1.23e+02;
double b = 1.23e02;
output(&a, sizeof(a));
output(&b, sizeof(b));
}
{
double a = 1.23e+02;
double b = 1.23e02;
printf("%lf\n", a);
printf("%lf\n", b);
}
{
printf("%lf\n", 1.23e+02);
printf("%lf\n", 1.23e02);
}
return 0;
}
$ gcc-debug -o main main.c
$ ./main
00 00 00 00 00 c0 5e 40
00 00 00 00 00 c0 5e 40
123.000000
123.000000
123.000000
123.000000
$
页:
[1]