From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bernard Hurley Newsgroups: gmane.emacs.bugs Subject: bug#20185: 24.4.50; problem with built-in function "ldexp" Emacs Ver: 24.4.50.1 Date: Mon, 23 Mar 2015 20:29:13 +0000 Message-ID: <87y4mn4fvq.fsf@snares-penguin.marcade.biz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427142630 22792 80.91.229.3 (23 Mar 2015 20:30:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Mar 2015 20:30:30 +0000 (UTC) To: 20185@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 23 21:30:19 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ya8zG-0007WT-Am for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Mar 2015 21:30:14 +0100 Original-Received: from localhost ([::1]:57933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya8zF-0002Gg-Ha for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Mar 2015 16:30:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya8zB-0002GK-Qs for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2015 16:30:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya8z6-0001rX-Ei for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2015 16:30:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya8z6-0001rM-Bz for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2015 16:30:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Ya8z5-00015n-Kx for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2015 16:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bernard Hurley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Mar 2015 20:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20185 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14271425704139 (code B ref -1); Mon, 23 Mar 2015 20:30:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Mar 2015 20:29:30 +0000 Original-Received: from localhost ([127.0.0.1]:34190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ya8yX-00014g-U1 for submit@debbugs.gnu.org; Mon, 23 Mar 2015 16:29:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38834) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ya8yV-00014T-Jk for submit@debbugs.gnu.org; Mon, 23 Mar 2015 16:29:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya8yP-00010p-Gm for submit@debbugs.gnu.org; Mon, 23 Mar 2015 16:29:22 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:53614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya8yP-00010l-EG for submit@debbugs.gnu.org; Mon, 23 Mar 2015 16:29:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya8yO-0002AZ-9c for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2015 16:29:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya8yK-0000y1-6t for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2015 16:29:20 -0400 Original-Received: from [86.53.51.141] (port=46821 helo=snares-penguin.marcade.biz) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya8yJ-0000xM-UX for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2015 16:29:16 -0400 Original-Received: by snares-penguin.marcade.biz (Postfix, from userid 1000) id EC7572A0B8E; Mon, 23 Mar 2015 20:29:13 +0000 (GMT) X-Attribution: Bernard X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100862 Archived-At: (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.