[LLVMdev] printing hex format for floating point number
Jim Grosbach
grosbach at apple.com
Tue Mar 6 13:48:43 PST 2012
You can bitcast it to an integer of the same size and print that, I believe. APFloat::bitcastToAPInt().
-Jim
On Mar 4, 2012, at 11:56 PM, Sirish Pande <spande at codeaurora.org> wrote:
> Hi,
>
> I am trying to print a hex value ( 4111999A for 9.1) for a corresponding floating point number. The routine convertToHexString in APFFloat class only prints in C99 Floating point hexagondecimal constant (eg 1.e00000p3).
>
> Without writing my own routine, how do I get to print the hexadecimal representation for a floating point value?
>
> Sirish
> --
> Qualcomm Innovation Center, Inc is a member of Code Aurora Forum
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120306/0b03155e/attachment.html>
More information about the llvm-dev
mailing list