none
WinDbg and .printf and floating-numbers RRS feed

  • Question

  • It seems that a floating-number is not correctly displayed in WinDbg using the ".printf" command.

    Simple example: Variable "double d = 2.3";

    Output this variable in WinDbg always gives "0.00000"

    Here is the comand I used:

    .printf "%f",@@c++(d)

    Also using the (correct 64-Bit) command has the same effect:

    .printf "%lf",@@c++(d)

    If I use the "integer" formatting then at least the first part of the number is displayed:

    .printf "%d",@@c++(d)

    I have tried several different WInDbg versions... it seems thet it does not work... it always outputs zero...

    Any solution to this????


    Jochen Kalmbach (MVP VC++)

    Thursday, July 17, 2014 9:12 PM

Answers

  • I realize this was asked awhile ago but just saw it while looking for something else. I found through some experimentation that this seems to work for double:

    .printf "%lf", qwo(@@(&d))

    I'm not sure if something similar works for 32-bit float or not. I'm also not sure why it doesn't just work with the simpler syntax in the original post... maybe a bug?

    Hope this helps,

    Jon

    Tuesday, March 17, 2015 9:13 PM