Revision a9b87a15
Added by Pierre-Loïc Garoche about 5 years ago
include/io_frontend.c | ||
---|---|---|
78 | 78 |
printf("\n"); |
79 | 79 |
fprintf(file, "%d\n", _V); |
80 | 80 |
} |
81 |
|
|
82 |
void _put_float(FILE* file, char* n, float _V){ |
|
83 |
if(ISATTY) { |
|
84 |
printf("%s = ", n); |
|
85 |
} else { |
|
86 |
printf("'%s': ", n); |
|
87 |
}; |
|
88 |
printf("'%.*f' ", PREC, _V); |
|
89 |
printf("\n"); |
|
90 |
fprintf(file, "%.*f\n", PREC, _V); |
|
91 |
} |
|
92 |
|
|
81 | 93 |
void _put_double(FILE* file, char* n, double _V){ |
82 | 94 |
if(ISATTY) { |
83 | 95 |
printf("%s = ", n); |
84 | 96 |
} else { |
85 | 97 |
printf("'%s': ", n); |
86 | 98 |
}; |
87 |
printf("'%f' ", _V);
|
|
99 |
printf("'%.*f' ", PREC, _V);
|
|
88 | 100 |
printf("\n"); |
89 |
fprintf(file, "%f\n", _V);
|
|
101 |
fprintf(file, "%.*f\n", PREC, _V);
|
|
90 | 102 |
} |
Also available in: Unified diff
Extending types to machine types