Use labs instead of abs where needed
authorAndy Wingo <wingo@pobox.com>
Tue, 21 Feb 2017 21:12:18 +0000 (22:12 +0100)
committerAndy Wingo <wingo@pobox.com>
Tue, 21 Feb 2017 21:12:18 +0000 (22:12 +0100)
* libguile/numbers.c (log_of_fraction): Use labs instead of abs on
  longs.  Thanks to Matt Wette for the tip.

libguile/numbers.c

index b926d2472c98037911cd056dc4dc86e7e024f05d..99b564e952a973b2c259cc76f356ef62b54b2857 100644 (file)
@@ -9953,7 +9953,7 @@ log_of_fraction (SCM n, SCM d)
   long n_size = scm_to_long (scm_integer_length (n));
   long d_size = scm_to_long (scm_integer_length (d));
 
-  if (abs (n_size - d_size) > 1)
+  if (labs (n_size - d_size) > 1)
     return (scm_difference (log_of_exact_integer (n),
                            log_of_exact_integer (d)));
   else if (scm_is_false (scm_negative_p (n)))