summaryrefslogtreecommitdiff
path: root/cmp.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-13 09:33:55 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-13 09:33:55 +0000
commit5e8873f5f0274388f5332951b3a1e03ef2ca7c92 (patch)
tree581c21acd8c80af7942b13f11a183a699dacde12 /cmp.c
parent14ea5598d1293bdc4f493102245c1a86aa0399bf (diff)
downloadmpfr-5e8873f5f0274388f5332951b3a1e03ef2ca7c92.tar.gz
improved coverage test
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2698 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'cmp.c')
-rw-r--r--cmp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/cmp.c b/cmp.c
index c0d583884..5b0767c2f 100644
--- a/cmp.c
+++ b/cmp.c
@@ -24,6 +24,7 @@ MA 02111-1307, USA. */
/* returns 0 iff b = sign(s) * c
a positive value iff b > sign(s) * c
a negative value iff b < sign(s) * c
+ This function ***does not*** handle NaN as input (undefined behaviour).
*/
int
@@ -48,11 +49,8 @@ mpfr_cmp3 (mpfr_srcptr b, mpfr_srcptr c, int s)
return -s;
else if (MPFR_IS_ZERO(b))
return MPFR_IS_ZERO(c) ? 0 : -s;
- else if (MPFR_IS_ZERO(c))
+ else /* necessarily c=0 */
return MPFR_SIGN(b);
- else
- /* Should never reach here */
- MPFR_ASSERTN(0);
}
/* b and c are real numbers */
if (s != MPFR_SIGN(b))