summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/bigdecimal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-08 06:29:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-08 06:29:13 +0000
commit859314cbc63f5473bf7dd34e1147ae4b6da0726a (patch)
treebe522f0c0f406c88be1ee29c3ff76cd4394bdc27 /ext/bigdecimal/bigdecimal.c
parent1a98b567af45a44c27b2aa776c71f580c2c6f887 (diff)
bigdecimal.c: suppress warnings
* ext/bigdecimal/bigdecimal.c (AddExponent): suppress strict-overflow warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/bigdecimal.c')
-rw-r--r--ext/bigdecimal/bigdecimal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 4d54642f483..21a117e8b54 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -3858,7 +3858,7 @@ AddExponent(Real *a, SIGNED_VALUE n)
goto overflow;
mb = m*(SIGNED_VALUE)BASE_FIG;
eb = e*(SIGNED_VALUE)BASE_FIG;
- if (mb < eb) goto overflow;
+ if (eb - mb > 0) goto overflow;
}
}
else if (n < 0) {
@@ -3867,7 +3867,7 @@ AddExponent(Real *a, SIGNED_VALUE n)
goto underflow;
mb = m*(SIGNED_VALUE)BASE_FIG;
eb = e*(SIGNED_VALUE)BASE_FIG;
- if (mb > eb) goto underflow;
+ if (mb - eb > 0) goto underflow;
}
a->exponent = m;
return 1;