aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorjohn haque <j.eh@mchsi.com>2012-03-19 04:30:00 -0500
committerjohn haque <j.eh@mchsi.com>2012-03-19 04:30:00 -0500
commit40645cb3cb155eb59dd745af4ae0e06e729c8eb1 (patch)
tree1c24a9a6cb2ac9acc985b3f4667c7139c10c4525 /profile.c
parentb5431a4825e325c61f4043e4d25e47d7891c228c (diff)
downloadegawk-40645cb3cb155eb59dd745af4ae0e06e729c8eb1.tar.gz
egawk-40645cb3cb155eb59dd745af4ae0e06e729c8eb1.tar.bz2
egawk-40645cb3cb155eb59dd745af4ae0e06e729c8eb1.zip
Add arbitrary-precision arithmetic on integers.
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/profile.c b/profile.c
index 48f90c63..7d5c07b2 100644
--- a/profile.c
+++ b/profile.c
@@ -1209,8 +1209,10 @@ pp_number(NODE *n)
emalloc(str, char *, PP_PRECISION + 10, "pp_number");
#ifdef HAVE_MPFR
- if (n->flags & MPFN)
+ if (is_mpg_float(n))
mpfr_sprintf(str, "%0.*R*g", PP_PRECISION, RND_MODE, n->mpg_numbr);
+ else if (is_mpg_integer(n))
+ mpfr_sprintf(str, "%Zd", n->mpg_i);
else
#endif
sprintf(str, "%0.*g", PP_PRECISION, n->numbr);