From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Newsgroups: gmane.emacs.bugs Subject: bug#25557: Documentation of format doesn't describe "g" accurately Date: Fri, 27 Jan 2017 17:05:28 -0500 Message-ID: <78ace0d5-59f1-0d7d-1f0e-b589a947d76c@live.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CPfuUa6ohRd60iSg1ITF1cE7l2ql720BF" X-Trace: blaine.gmane.org 1485554794 27589 195.159.176.226 (27 Jan 2017 22:06:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 27 Jan 2017 22:06:34 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 To: 25557@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 27 23:06:27 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXEem-0005NS-GA for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Jan 2017 23:06:08 +0100 Original-Received: from localhost ([::1]:49039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXEer-0005yA-Ku for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Jan 2017 17:06:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXEel-0005y3-BF for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 17:06:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXEeg-0002Xe-Cx for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 17:06:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50420) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cXEeg-0002Xa-9O for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 17:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cXEeg-00059Q-0G for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 17:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Jan 2017 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25557 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.148555475319785 (code B ref -1); Fri, 27 Jan 2017 22:06:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jan 2017 22:05:53 +0000 Original-Received: from localhost ([127.0.0.1]:48619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXEeX-000591-56 for submit@debbugs.gnu.org; Fri, 27 Jan 2017 17:05:53 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXEeV-00058o-Sp for submit@debbugs.gnu.org; Fri, 27 Jan 2017 17:05:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXEeP-0002VM-UT for submit@debbugs.gnu.org; Fri, 27 Jan 2017 17:05:46 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51065) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cXEeP-0002VI-Qg for submit@debbugs.gnu.org; Fri, 27 Jan 2017 17:05:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXEeO-0005xt-QC for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 17:05:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXEeJ-0002Uq-Om for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 17:05:44 -0500 Original-Received: from mout.kundenserver.de ([212.227.17.13]:51809) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cXEeJ-0002UX-Aw for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 17:05:39 -0500 Original-Received: from [18.26.2.123] ([18.26.2.123]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.184]) with ESMTPSA (Nemesis) id 0LiUUm-1bwnyH0CxI-00cged for ; Fri, 27 Jan 2017 23:05:37 +0100 X-Provags-ID: V03:K0:679LVBPNitz+AD7vzxJIvoFOPd6BiLEFEwXMWRbd8NRXpZ74BAv R33o3rJ6DD0HCyC3le70vCBXkBpUqjjWxZHrBTLfZB6lST90sCwQ8SaamDhMYTw5mw076hc B8BLV+/BqV/MOMGJmkKgzRrBJaAv1DKvom1nb7qv/fpcvJp7agIlAW4HR/XuwEpJBJOpULb d1s6UjFcwB7s6M9kXcSRA== X-UI-Out-Filterresults: notjunk:1;V01:K0:QBizpag/X54=:tFsnJlcluvl5wFSSVkD6U7 bnLRLrM9l1yvq3asFX90QTSBWwIG8CFN+yGxppVPImJO+ES2rxWRqBx9ZErivgl2LTMs1ZRzG NscBzeW1aAtr0wO4FDk8kLP3wkkRX7sPpttbjlrXYe3iDtHixR/l1QK/y2B3CJnuQNb8mBZHQ 7NXSzwnSsdWVZU6OmaEP5v4FPWczelcbFWURBkapRumEsHDgKxBBDW828OgmyyRXCooG43R6V SzePO/gyzjKrhvJVVmHNHv7esTWQweL/PRpvqp38p+rrld3UhRrLdQ3QgguoQqlTlYCh+vJU7 JmyEKnrdlUE3SrpI+dU/i+z1TW/qJoYbeOMrviYvO+3jhi0EVmtggj8pZ7pBzUoTqGXY3AVH3 /TjN+aWJglRNU1FGoO/O2+r6VMVYKD4no9DWxAA0i/enbYg7e5BHgxbiyE6N2kbBg2Yqpefz9 /aIurn8H4jodF5HYI6gPcrCu5XanD+TiWDdfEd0wa2bCxYJGXt3ppa/s9BuBwyeWVv7HK8jYi AM/9vpsFCVxbBZR2P43gwIgN+ib648wkkPUV+sqNTWZ4hsIsyHGwrIxJay1hQYzb+LyBn16Bd NydhCO+Om+nV7SJ4csyy1+AFSG1D6myk9iX0Q6Pi2FzabqAAdVmjHj+BUFjs1VDtloje8OgfI uuL1mjzmTGUafxV1EKA6Yu24aTPqW3Hwmoz5dGtiFD6fSbtSeW5eB45UHUYkzFptJxXI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:128699 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CPfuUa6ohRd60iSg1ITF1cE7l2ql720BF Content-Type: multipart/mixed; boundary="KcLWNoI2AhR7mxmo1hX2FRApkHLKLx7ap"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: bug-gnu-emacs@gnu.org Message-ID: <78ace0d5-59f1-0d7d-1f0e-b589a947d76c@live.com> Subject: Documentation of format doesn't describe "g" accurately --KcLWNoI2AhR7mxmo1hX2FRApkHLKLx7ap Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi emacs, There seems to be a few issues in the docstring of `format': > %g means print a number in exponential notation > or decimal-point notation, whichever uses fewer characters. This seems wrong: (format "%g" 3.0) =E2=87=92 "3", but (format "%f" 3.0) =E2=87=92 "3.000000", and (format "%e" 3.0) =E2=87=92 "3.000000e+00", so %g is neither %f nor %e.= > The # flag means to use an alternate display form [...] > for %e, %f, and %g, it causes a decimal point to be included even if > the precision is zero. This seems incomplete: (format "%#.5g" 3) =E2=87=92 "3.0000", while (format "%.5g" 3) =E2=87=92 "3", so # doesn't just cause changes when t= he precision is 0. > For %e, %f, and %g sequences, the number after the "." in the > precision specifier says how many decimal places to show This seems wrong, too: (format "%.5g" 3.0) =E2=87=92 "3", not "3.00000" (format "%.5g" 3.1) =E2=87=92 "3.1", not "3.10000" Similar problems seem to exist in the actual documentation. On a related = note, is there a way to get a shortest representation of a number? Someth= ing like %g, but without exponents. Thanks! Cl=C3=A9ment. --KcLWNoI2AhR7mxmo1hX2FRApkHLKLx7ap-- --CPfuUa6ohRd60iSg1ITF1cE7l2ql720BF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYi8QpAAoJEPqg+cTm90wjU3cQALPz0Di4VRCZyGKZwVWHzlH4 JVWKmUf7pCUTfuA6umnGM67jHAf1Nla6IwPeZmee9s/NevF9tYUSrJQGHjicboIZ mLk9U8vXls9F92EyvYD2fgv1+HQIjovrzLM0vTesBAfsJjVNbSi0KJ1C/sgTTCY1 sYHEeeZ1IB0ptxsCv3vP3Vywq+H0isM04dwJkcbi32Uz7MTAXV8B7FsrdaCl6rBG Q4c0PbHiAWOr+C+xhicXit5gyduCCjFM03b9VICTgoD10APhx79XldyOl5suOy1m Eli/tvpY282Rp7uvb5yDdXUGuGePRmkn6iRNnuXeSKYvjuzOom98WUwXMFsKTlAY dzAi4GWqJ2AejWDGMhd1CmmqGqhHuHwcdlDhJoWZQf6l2cg25ChG673rd743hq28 rdDvo5MaxKaQDnJWovwTToS4FlCRg/FMPbEzWWCPs7A5viNaLGGzWWl8ygHjiTIy 6Xusd5/Jyn6kGnjo9/XBDhNWU9vYcz7BjhGIbG4kPrUes8+OOAsYs3vEYJlgpoRU RIr1GKD2e4rFnRslDauZX2J3W/0wOHR7oUg68m58BykgqCHrJucJJ4XKeH3G/+yI 41Led4OyyVgsJsGUt15CXpEchtU3tdxVVwj6z2m/zmoUGaIvnkSVtnatUH8dqhLX QtmsOzRU6AL4p3p7qwUb =dzsI -----END PGP SIGNATURE----- --CPfuUa6ohRd60iSg1ITF1cE7l2ql720BF--