diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-10-15 12:46:05 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-10-15 12:46:05 +0000 |
commit | 7a625a16a1f5059f3ab26c49b094515d1f7d722e (patch) | |
tree | 060bf2b535576e6210d1af9d88ff800f07323f3f /Build/source/texk/web2c/mplibdir/mpmathbinary.w | |
parent | 443caaed8dfcfd314acf6b8015a2c683c749b978 (diff) |
web2c/mplibdir: Sync with the upstream.
git-svn-id: svn://tug.org/texlive/trunk@38645 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/mplibdir/mpmathbinary.w')
-rw-r--r-- | Build/source/texk/web2c/mplibdir/mpmathbinary.w | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/mplibdir/mpmathbinary.w b/Build/source/texk/web2c/mplibdir/mpmathbinary.w index 43edabab86c..f20061de46a 100644 --- a/Build/source/texk/web2c/mplibdir/mpmathbinary.w +++ b/Build/source/texk/web2c/mplibdir/mpmathbinary.w @@ -896,14 +896,14 @@ void mp_wrapup_numeric_token(MP mp, unsigned char *start, unsigned char *stop) { invalid = mpfr_set_str(result,buf, 10, ROUNDING); //fprintf(stdout,"scan of [%s] produced %s, ", buf, mp_binnumber_tostring(result)); lp = (unsigned long) l; - /* strip leading - or + or 0 or .*/ if ( (*bufp=='-') || (*bufp=='+') || (*bufp=='0') || (*bufp=='.') ) { lp--; bufp++;} /* strip also . */ lp = strchr(bufp,'.') ? lp-1: lp; /* strip also trailing 0s */ bufp = buf+l-1; - while(*bufp == '0') {bufp--; lp--;} + while(*bufp == '0') {bufp--; lp=( (lp==0)||(lp==1)?1:lp--);} + /* force at last one digit, even if the number is 0 */ lp = lp>0? lp: 1; /* bits needed for buf */ lpbit = (unsigned long)ceil(lp/log10(2)+1); |