[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 37d3c16 2/2: Tiny simplification of frac_to_double
From: |
Paul Eggert |
Subject: |
master 37d3c16 2/2: Tiny simplification of frac_to_double |
Date: |
Thu, 19 Mar 2020 03:11:22 -0400 (EDT) |
branch: master
commit 37d3c1618b6cdf7efc90015fb2786aa30ef0de47
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Tiny simplification of frac_to_double
* src/timefns.c (frac_to_double): Remove unnecessary runtime check,
since the denominator is always positive.
---
src/timefns.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/timefns.c b/src/timefns.c
index a9595b5..7bcc37d 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -593,7 +593,7 @@ timespec_to_lisp (struct timespec t)
}
/* Return NUMERATOR / DENOMINATOR, rounded to the nearest double.
- Arguments must be Lisp integers, and DENOMINATOR must be nonzero. */
+ Arguments must be Lisp integers, and DENOMINATOR must be positive. */
static double
frac_to_double (Lisp_Object numerator, Lisp_Object denominator)
{
@@ -601,7 +601,6 @@ frac_to_double (Lisp_Object numerator, Lisp_Object
denominator)
if (FASTER_TIMEFNS
&& integer_to_intmax (numerator, &intmax_numerator)
&& integer_to_intmax (denominator, &intmax_denominator)
- && ! INT_DIVIDE_OVERFLOW (intmax_numerator, intmax_denominator)
&& intmax_numerator % intmax_denominator == 0)
return intmax_numerator / intmax_denominator;