diff options
| author | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-05 14:03:09 +0000 |
|---|---|---|
| committer | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-05 14:03:09 +0000 |
| commit | e17032c3dea4216f7ffbe445e5a9b43ea7d38658 (patch) | |
| tree | fbac07929bec3cf0442bfe1d01ee4fcf85f445af | |
| parent | c33ced10d467435941295364fcf5c1fd7db0e778 (diff) | |
| download | ruby-e17032c3dea4216f7ffbe445e5a9b43ea7d38658.tar.gz ruby-e17032c3dea4216f7ffbe445e5a9b43ea7d38658.tar.xz ruby-e17032c3dea4216f7ffbe445e5a9b43ea7d38658.zip | |
Trailing 0s in split removed. & bug in floor fixed.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ext/bigdecimal/bigdecimal.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 4f747e292..166e01e2d 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -3154,6 +3154,7 @@ VpSzMantissa(Real *a,char *psz) } } *psz = 0; + while(psz[-1]=='0') *(--psz) = 0; } else { if(VpIsPosZero(a)) sprintf(psz, "0"); else sprintf(psz, "-0"); @@ -3728,8 +3729,9 @@ VpMidRound(Real *y, int f, int nf) VpNmlz(y); VpRdup(y,0); } else { + S_INT s = VpGetSign(y); VpSetOne(y); - VpSetSign(y,VpGetSign(y)); + VpSetSign(y,s); } } else { y->frac[ix] = div; |
