emacs-devel
[Top][All Lists]
Advanced

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

Re: How to use a float value with either GLYPH_DEBUG or NSTRACE


From: Anders Lindgren
Subject: Re: How to use a float value with either GLYPH_DEBUG or NSTRACE
Date: Tue, 22 Aug 2017 13:51:06 +0200

Hi!

On Tue, Aug 22, 2017 at 1:32 PM, Noam Postavsky <address@hidden> wrote:
On Tue, Aug 22, 2017 at 4:23 AM, Anders Lindgren <address@hidden> 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


reply via email to

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