Project

General

Profile

Revision f5a568dd

View differences:

include/io_frontend.c
67 67
  printf("'%i' ", (_V)? 1 : 0);
68 68
  printf("\n");
69 69
  fprintf(file, "%i\n", _V);
70
  fflush(file);
70 71
}
71 72
void _put_int(FILE* file, char* n, int _V){
72 73
  if(ISATTY) {
......
77 78
  printf("'%d' ", _V);
78 79
  printf("\n");
79 80
  fprintf(file, "%d\n", _V);
81
  fflush(file);
80 82
}
81
void _put_double(FILE* file, char* n, double _V){
83

  
84
void _put_float(FILE* file, char* n, float _V, int PREC){
85
  if(ISATTY) {
86
    printf("%s = ", n);
87
  } else {
88
    printf("'%s': ", n);
89
  };
90
  printf("'%.*f' ", PREC, _V);
91
  printf("\n");
92
  fprintf(file, "%.*f\n", PREC, _V);
93
  fflush(file);
94
}
95

  
96
void _put_double(FILE* file, char* n, double _V, int PREC){
82 97
  if(ISATTY) {
83 98
    printf("%s = ", n);
84 99
  } else {
85 100
    printf("'%s': ", n);
86 101
  };
87
  printf("'%f' ", _V);
102
  printf("'%.*f' ", PREC, _V);
88 103
  printf("\n");
89
  fprintf(file, "%f\n", _V);
104
  fprintf(file, "%.*f\n", PREC, _V);
105
  fflush(file);
90 106
}

Also available in: Unified diff