[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: |
Keith David Bershatsky |
Subject: |
Re: How to use a float value with either GLYPH_DEBUG or NSTRACE |
Date: |
Mon, 21 Aug 2017 13:51:00 -0700 |
Thank you, Alan:
I had erroneously assumed that `%f` was only for adding/removing decimal places
or rounding, rather than to show the approximate value of a `double` in this
context.
I ran a few tests and am guessing that `%f` uses six (6) decimal places. I
understand that %f can be used to increase/decrease the number of decimal
places. However, this leaves me guessing exactly what the double looks like.
If the double is exactly 1.0, then it would be nice to see the same thing
rather than 1.000000. If the double is several decimal places, then I'd like
to see the whole thing.
Then again, it is possible that the snippet in the opening thread is producing
a double of exactly six (6) decimal places, but I do not know for sure if that
is the case.
So the `%f` solution give me 99% of what I was looking for, which is certainly
sufficient to handle this particular issue. If you or anyone else have a way
to print the exact value of whatever the double is (without adding/removing
decimal places), an additional approach would be appreciated.
Keith
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DATE: [08-21-2017 13:07:56] <21 Aug 2017 21:07:56 +0100>
FROM: Alan Third <address@hidden>
>
> * * *
>
> Is it not just like printf?
>
> NSTRACE("float: %f", var);
>
> --
> Alan Third