Re: How are Float data types stored?
Posted in 1994
Topics: Data Types & Schema Design, Third-Party Tools & Monitoring
In article <CLFI6q.CyE@massive.its.bldrdoc.gov> jcantu@its.bldrdoc.gov writes: > > Does anyone out there know how Float >and SmallFloat datatypes are stored in >INFORMIX or for that matter how one would >offer: > > INFORMIX(HEX) Actual Number > _____________ _____________ > > 000000000000e03f 0.50 This is in standard IEEE double precision form. You are listing from low order byte to high order byte. In a little-endian, byte addressable machine this would be in memory locations from low to high as: 00 00 00 00 00 00 e0 3f or written out from high bit to low: 3fe0000000000000 the high bit is sign, the next eleven are the exponent (for base of 2) in bias 1023 (ie. take the unsigned binary value and subtract 1023 to get the actual value of the exponent) and the next 52 bits are the fractional part of the mantissa. (there is an assumed "1." in front of the 52 bits for a normalized number.) If you figure this out it comes to 1*2^(-1) which is correct. Mark Kaehny University of Wisconsin-Milwaukee