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

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

[debbugs-tracker] bug#20185: closed (24.4.50; problem with built-in func


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#20185: closed (24.4.50; problem with built-in function "ldexp" Emacs Ver: 24.4.50.1)
Date: Tue, 24 Mar 2015 18:58:01 +0000

Your message dated Tue, 24 Mar 2015 11:57:10 -0700
with message-id <address@hidden>
and subject line Re: 24.4.50; problem with built-in function "ldexp" Emacs Ver: 
24.4.50.1
has caused the debbugs.gnu.org bug report #20185,
regarding 24.4.50; problem with built-in function "ldexp" Emacs Ver: 24.4.50.1
to be marked as done.

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


-- 
20185: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20185
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.4.50; problem with built-in function "ldexp" Emacs Ver: 24.4.50.1 Date: Mon, 23 Mar 2015 20:29:13 +0000
(24.4.50) 3.2 Floating-Point Basics we read:

---------- snip ------------
 -- Function: ldexp sig &optional exp
     This function returns a floating-point number corresponding to the
     significand SIG and exponent EXP.
----------snip -------------

However it is easy to verify that the second argument is not
optional. For example:

    (ldexp 5.0)

triggers the error:

    *** Eval error ***  Wrong type argument: integerp, nil

The code for ldexp in floatfn.c reads:

---------- snip ---------------
DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0,
       doc: /* Construct number X from significand SGNFCAND and exponent EXP.
Returns the floating point value resulting from multiplying SGNFCAND
(the significand) by 2 raised to the power of EXP (the exponent).   */)
  (Lisp_Object sgnfcand, Lisp_Object exponent)
{
  CHECK_NUMBER (exponent);
  return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exponent)));
}
---------- snip -------------

The declaration conforms to that in the manual but nothing seems to have
been done to take into account what happens when `exp' is missing.  It
seems to me that there are two possibilities:

EITHER: The declaration in floatfns.c is incorrect and should read:

    DEFUN ("ldexp", Fldexp, Sldexp, 1, 1, 0,
    ....

In which case it will need to be changed and the manual will need to be
changed accordingly.


OR: `exp' is supposed to have a default value (0 say), when the code in
floatfns.c should be changed accordingly.  In this case it might still
be a good idea to update the manual to explain that it has this value.



--- End Message ---
--- Begin Message --- Subject: Re: 24.4.50; problem with built-in function "ldexp" Emacs Ver: 24.4.50.1 Date: Tue, 24 Mar 2015 11:57:10 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 Thanks for catching that bug. While fixing it I noticed some related minor glitches with ldexp, so I installed the attached patch.

Attachment: 0001-Fix-minor-ldexp-issues.patch
Description: Text Data


--- End Message ---

reply via email to

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