emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#25786: closed ([PATCH] use of abs() in numbers.c:


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#25786: closed ([PATCH] use of abs() in numbers.c: should be labs())
Date: Tue, 21 Feb 2017 21:14:02 +0000

Your message dated Tue, 21 Feb 2017 22:13:11 +0100
with message-id <address@hidden>
and subject line Re: bug#25786: [PATCH] use of abs() in numbers.c: should be 
labs()
has caused the debbugs.gnu.org bug report #25786,
regarding [PATCH] use of abs() in numbers.c: should be labs()
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
25786: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25786
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] use of abs() in numbers.c: should be labs() Date: Sat, 18 Feb 2017 09:46:07 -0800
In libguile/numbers.c abs() is used for long argument where labs() should be used.  
A patch is included below for guile-2.1.7.

/* Returns log(n/d), for exact non-zero integers n and d */
static SCM
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)
    return (scm_difference (log_of_exact_integer (n),
                            log_of_exact_integer (d)));


--- libguile/numbers.c.orig 2017-02-18 08:29:52.000000000 -0800
+++ libguile/numbers.c 2017-02-18 08:30:23.000000000 -0800
@@ -9951,7 +9951,7 @@
   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)))


--- End Message ---
--- Begin Message --- Subject: Re: bug#25786: [PATCH] use of abs() in numbers.c: should be labs() Date: Tue, 21 Feb 2017 22:13:11 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
On Sat 18 Feb 2017 18:46, Matt Wette <address@hidden> writes:

> In libguile/numbers.c abs() is used for long argument where labs() should be 
> used. 
> A patch is included below for guile-2.1.7.

Applied.  Thank you!

Andy


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]