[LLVMdev] Floating-Point Constants

Dale Johannesen dalej at apple.com
Mon Apr 21 12:46:30 PDT 2008


On Apr 19, 2008, at 9:34 PM, Jon Sargeant wrote:

> I'm confused about the hexadecimal format for entering floating-point
> constants.  The bit pattern for 1.0 as a single-precision float is
> 0x3f800000.  I tried entering the constant as 'float 0x3f800000', but
> the assembler said the constant was invalid for the type.  The bit
> pattern for 1.0 as a double-precision float is 0x3ff0000000000000,  
> so I
> entered the constant as 'float 0x3ff0000000000000', and it worked.
> Is this the correct behavior?

Yes, it is.




More information about the llvm-dev mailing list