From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.devel Subject: Re: How to use a float value with either GLYPH_DEBUG or NSTRACE Date: Tue, 22 Aug 2017 13:51:06 +0200 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1144a920eedc310557563509" X-Trace: blaine.gmane.org 1503402695 4690 195.159.176.226 (22 Aug 2017 11:51:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 Aug 2017 11:51:35 +0000 (UTC) Cc: Alan Third , Keith David Bershatsky , emacs-devel , Paul Eggert To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 22 13:51:30 2017 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 1dk7iI-0000Ii-6O for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2017 13:51:18 +0200 Original-Received: from localhost ([::1]:38361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dk7iO-0006LL-Nu for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2017 07:51:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dk7i9-0006Hg-7W for emacs-devel@gnu.org; Tue, 22 Aug 2017 07:51:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dk7i8-0006PI-Ff for emacs-devel@gnu.org; Tue, 22 Aug 2017 07:51:09 -0400 Original-Received: from mail-vk0-x22c.google.com ([2607:f8b0:400c:c05::22c]:37348) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dk7i8-0006NY-9c for emacs-devel@gnu.org; Tue, 22 Aug 2017 07:51:08 -0400 Original-Received: by mail-vk0-x22c.google.com with SMTP id r199so58339322vke.4 for ; Tue, 22 Aug 2017 04:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wCbUCscQD7av+9pHB+wi5RJuomjK464GasSDNIQ+ssc=; b=YmF8fJPAKNFTlXYJ0JxfEoyO5Nv7p1+FQ4iS9ImQNHPzIyhpb9/wMOP1VrX9On4DNl ZaTI/nIiYEyvcca5ncYBsilp0fiBgR9Q1HtNFPlvvhiM54uaBiNCt6N84pfAbFitHefo VayC4tKcUb7mlhsnYF2xxvkaj4EC+RJ0XCD8lQRaEcI+f7R2ciHJ0zPRkpiZZd9rkCfy n3qfzPPI2w8M5dg10kUSgN8Bunq9YiDd0MUyrGbAB/fJ3hUI+qEBbcIiVhtg6JGbZwbu 5LHRR3Yz72pq8gTFiTeFoOSpWOzW7JEW0EmwkPK24a5t9ZG4FlAH+RzszGUNCckcyS/T lahg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wCbUCscQD7av+9pHB+wi5RJuomjK464GasSDNIQ+ssc=; b=GVcQaLGSfTGcaV8E1vtaOw2QUoUd6+QPfwxabu57EZSW/l8p6WDG0hVVVY0dApB6Gk 0m57CcFdMIS2d2b5nQBoGoTZT6zhwhegp61/li8uKuhpBzGFDl6/cesG5joZR/41+R31 m3VCJpcSvhWz3c3z4SGBmTEEbMn6DtY/jiSZwLgB1v4tvECu3cDtDc1iYcMuo0gtEqbF kKLqgNFRxFrL6/rz5q1ZC51cMUC2sZ1VPj6IYpRPOiWhG35yeGWI9//L1JJFy+svlQsr 9Bhf1COizVGTXIKTEGJle04UCEdLg2G0z7uS04ZUrkqwHDvawGiOSTZ9anjrJMMeAgA0 RZcw== X-Gm-Message-State: AHYfb5iWcH9l6UUOuIVZ/sBzL8QlaFkdvB3bwBMfs0ttssTONo/0Ucao 753MZoCqMMcs2xs829WKq481VZ2yLA== X-Received: by 10.31.51.10 with SMTP id z10mr182255vkz.136.1503402667202; Tue, 22 Aug 2017 04:51:07 -0700 (PDT) Original-Received: by 10.31.171.3 with HTTP; Tue, 22 Aug 2017 04:51:06 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c05::22c 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:217682 Archived-At: --001a1144a920eedc310557563509 Content-Type: text/plain; charset="UTF-8" Hi! On Tue, Aug 22, 2017 at 1:32 PM, Noam Postavsky < npostavs@users.sourceforge.net> wrote: > On Tue, Aug 22, 2017 at 4:23 AM, Anders Lindgren > wrote: > > > I think(*) you can use "%a" to print the hexadecimal representation of a > > floating point number. This prints the floating point number exactly, > down > > to the last bit in the mantissa. It looks like 0x0.3p10, where 0x0.3 is > the > > "significant" part and "p10" the binary exponent, and it represents the > > number 0x0.3 * 2^10. > > I think this is GNU libc specific, also not as readable for humans. > It's part of the C99 standard, see paragraph 7.19.6.1. True, that it's not as readable. However, in this case it appeared important to see the exact value. One approach might be to print it both as a normal number and as a hexadecimal number, after all it is only used for trace output when debugging the NS port. -- Anders --001a1144a920eedc310557563509 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi!

On Tue, Aug 22, 2017 at 1:32 PM, Noam Postavsky &l= t;npost= avs@users.sourceforge.net> wrote:
On Tue, Aug 22, 2017 at 4:23 AM, Anders Lindgren &l= t;andlind@gmail.com> wrote:

> I think(*) you can use "%a" to print the hexadecimal represe= ntation of a
> floating point number. This prints the floating point number exactly, = down
> to the last bit in the mantissa. It looks like 0x0.3p10, where 0x0.3 i= s the
> "significant" part and "p10" the binary exponent, = and it represents the
> number 0x0.3 * 2^10.

I think this is GNU libc specific, also not as readable for humans.<= br>

It's part of the C99 standard, see = paragraph 7.19.6.1.

True, that it's not as rea= dable. However, in this case it appeared important to see the exact value. = One approach might be to print it both as a normal number and as a hexadeci= mal number, after all it is only used for trace output when debugging the N= S port.

=C2=A0 =C2=A0 -- Anders

--001a1144a920eedc310557563509--