=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/pexpr.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -p -r1.9 -r1.10 --- OpenXM_contrib2/asir2000/io/pexpr.c 2000/12/22 10:03:30 1.9 +++ OpenXM_contrib2/asir2000/io/pexpr.c 2001/03/09 01:44:10 1.10 @@ -44,7 +44,7 @@ * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. - * $OpenXM: OpenXM_contrib2/asir2000/io/pexpr.c,v 1.8 2000/12/16 06:16:10 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/pexpr.c,v 1.9 2000/12/22 10:03:30 saito Exp $ */ #include "ca.h" #include "al.h" @@ -65,6 +65,7 @@ char DFORMAT[BUFSIZ]; int hex_output; int fortran_output; int double_output; +int real_digit; #define TAIL #define PUTS(s) fputs(s,OUT) @@ -336,6 +337,8 @@ int printmode = PRINTF_G; void PRINTNUM(q) Num q; { + char real_format[20]; + if ( !q ) { PUTS("0"); return; @@ -362,7 +365,13 @@ Num q; case MID_PRINTF_G: #endif default: - TAIL PRINTF(OUT,"%g",BDY((Real)q)); + if ( real_digit ) { + sprintf(real_format, + double_output?"%%.%df":"%%.%dg",real_digit); + TAIL PRINTF(OUT,real_format,BDY((Real)q)); + } else { + TAIL PRINTF(OUT,double_output?"%f":"%g",BDY((Real)q)); + } break; } break;