From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: Using the GNU GMP Library for Bignums in Emacs Date: Mon, 7 May 2018 13:24:58 -0400 Message-ID: References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> <83bmecy6fx.fsf@gnu.org> <0d3175d8-d996-651e-b221-71978bde3a65@cs.ucla.edu> <42cbc5ab-2f02-4aa5-4b19-7b2357f91692@cs.ucla.edu> <1f58acbf-a7d8-bf4e-3d0e-a285515a22e6@cs.ucla.edu> <2549728d-8e40-b46a-009e-07cef0c24208@cs.ucla.edu> <63fdd138-77d3-89b9-aa69-490300f588a9@cs.ucla.edu> <838t90pr2l.fsf@gnu.org> <85ec3668-6b66-e47a-c10a-ffb3fc8be5d5@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1525713820 5656 195.159.176.226 (7 May 2018 17:23:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 May 2018 17:23:40 +0000 (UTC) Cc: eliz@gnu.org, eggert@cs.ucla.edu, eller.helmut@gmail.com, emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 07 19:23:36 2018 Return-path: Envelope-to: ged-emacs-devel@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 1fFjrJ-0001J6-M5 for ged-emacs-devel@m.gmane.org; Mon, 07 May 2018 19:23:33 +0200 Original-Received: from localhost ([::1]:47349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFjtP-0003e1-32 for ged-emacs-devel@m.gmane.org; Mon, 07 May 2018 13:25:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFjsp-0003dj-QW for emacs-devel@gnu.org; Mon, 07 May 2018 13:25:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fFjsk-0005O9-U0 for emacs-devel@gnu.org; Mon, 07 May 2018 13:25:07 -0400 Original-Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:33285) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fFjsk-0005NE-M4 for emacs-devel@gnu.org; Mon, 07 May 2018 13:25:02 -0400 Original-Received: by mail-qt0-x235.google.com with SMTP id e8-v6so32447830qth.0 for ; Mon, 07 May 2018 10:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raeburn-org.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ozpkdTP7Kug+PQH5rx9UwB6TBso2Tv+TqCTkbLSXU/g=; b=unZCVrxRwzUZzo6UT5i3EOb7uEY6DyHTyzlAPRaBWxwplj7IdtwogtnTfC1uBLBNMy xuhkDPXsdcTZjhYu8Fiyt+ekmxABx+ScHgG6RQc3IxcAP/2wm1A+FOfF7WLlZE5ZdYw2 c/wDdfXwh0LxfvVt7GVPhkYvcFBnYa5gz1jxo+bSfUzWeigyA/uCOz58/BQTM2QDmOAk 2U+1/0WlPcoOCF8m5uKrwt+z4p6WnaVsg9YPQIjqONcOAI4d6+v6XmHVR0tTPYUncO7J 7PrflA32pQQjK/I1c/Xhb1Y8yap9wxOEEuHiOjT2831qL733kHI5al2zIUBpzWfF7H6n c6ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ozpkdTP7Kug+PQH5rx9UwB6TBso2Tv+TqCTkbLSXU/g=; b=Vgb9PV19da3NauHPdDquCMLhGnME7ap2r0nUkKUrPuB1ss6fW2tz7BaZ+O1l8StclF cSDlDiU9d3oOjjOxKH3MMXJQ3S9t1jUs0vs4e+/A7OsryOCWxWgHCc/DEg35bF5JnJwW WPrcgW0bXkzsuGwNrorYnPBvDTrGc3T0DpMoWbpDXw9urynK22IIeRi2rN3QHM7PMzfS LFWnRVP8kKtgtlQTkQ2BxQJZ+UE5myuOjZmv4zZTPCIXLds0KczIYt6c8hNYP3envh5B /n0rSBGpQm9O0lOFmLNoi306eExnt5DW3takHWRmmnr2LW0i4nQLcErGRWbSAY8lUB3I xhsw== X-Gm-Message-State: ALQs6tA3jNAic9H0DLBpSSFAEwRtGAeRAe0uAVgeSPw9GbpZJDa4A2I4 06ioiIiljfudD6jjG4+XURLctg== X-Google-Smtp-Source: AB8JxZqO4TSk+SYSNGss/NFXk+OlJvmVKomNdTHC4LH3vukixAO5TDLwC0xvkbtAAFvOvJqPKOrxUg== X-Received: by 2002:aed:2374:: with SMTP id i49-v6mr29222011qtc.412.1525713901834; Mon, 07 May 2018 10:25:01 -0700 (PDT) Original-Received: from [192.168.23.135] (c-73-253-167-23.hsd1.ma.comcast.net. [73.253.167.23]) by smtp.gmail.com with ESMTPSA id 41-v6sm19962092qtz.37.2018.05.07.10.25.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 May 2018 10:25:00 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3445.5.20) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225125 Archived-At: On May 5, 2018, at 23:12, Richard Stallman wrote: >=20 > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] >=20 >>> Another idea: %Nx with a negative number should output its 2's >>> complement representation in 4N bits. >=20 >> That's already taken: A leading =E2=80=9C-=E2=80=9C means to = left-justify the output if the specified width is wider than required. >=20 > We are miscommunicating. I'm talking about what %Nx should do when > outputting an argument that is negative, as in (format "%16x" -63). >=20 > Sorry that wasn't clear. >=20 > You could try p/x -63 in GDB to see what I mean. Oh, I see. Yes, I misunderstood. Apologies for my confusion. So, in this case, would it truncate the output or use a wider field, if = the value couldn=E2=80=99t =E2=80=9Cproperly=E2=80=9D be shown in the = specified size? E.g., -5000 would display in hex as =E2=80=A6ffec78; with a format = =E2=80=9C%2x=E2=80=9D should it return =E2=80=9C78=E2=80=9D or should it = get enough digits to show the minimum number of bits needed to express = the real value, much like formatting with =E2=80=9C%2d=E2=80=9D would = still give you =E2=80=9C-5000=E2=80=9D instead of chopping off relevant = digits? Maybe we can supply both bit count and minimum field width in a format = string=E2=80=A6 =E2=80=9C%32!8x=E2=80=9D to display the lowest 32 bits = in 8 columns but with leading spaces rather than zeros? Or swap the = positions of the numbers. And maybe one could be optional; =E2=80=9C%32!x=E2= =80=9D could mean either =E2=80=9C%32!8x=E2=80=9D (eight columns, = leading spaces) or =E2=80=9C%32!1x=E2=80=9D (minimum one column, i.e., = no leading spaces or zeros added). It would be logical to consider whether the same format extensions would = be useful with %o or %d (or others?) being used to format bignums. Ken=