=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/spexpr.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -p -r1.42 -r1.43 --- OpenXM_contrib2/asir2000/io/spexpr.c 2018/03/29 07:50:06 1.42 +++ OpenXM_contrib2/asir2000/io/spexpr.c 2019/11/12 10:52:05 1.43 @@ -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/spexpr.c,v 1.41 2018/03/29 01:32:53 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/spexpr.c,v 1.42 2018/03/29 07:50:06 ohara Exp $ */ #include "ca.h" #include "al.h" @@ -115,6 +115,10 @@ extern int hideargs; #define PRINTFNODENODE sprintfnodenode #define PRINTFARGS sprintfargs +#if defined(INTERVAL) +#define PRINTBF4ITV sprintbf4itv +#endif + #include "pexpr_body.c" /* special functions for string output */ @@ -136,3 +140,18 @@ void sprintbf(BF a) TAIL PUTS(s); mpfr_free_str(s); } + +#if defined(INTERVAL) +void sprintbf4itv(BF a) +{ + int dprec; + char fbuf[BUFSIZ]; + char *s; + dprec = a->body->_mpfr_prec*0.30103; + dprec += 1; + sprintf(fbuf,"%%.%dR%c",dprec,(double_output==1)?'f':(double_output==2)?'e':'g'); + mpfr_asprintf(&s,fbuf,a->body); + TAIL PUTS(s); + mpfr_free_str(s); +} +#endif