in reply to Re^3: Unpacking extended-double precision floats
in thread Unpacking extended-double precision floats

If loss of precision is of no concern, and the number of bits of exponent and sign is the same between d and D formats, you may be able to use unpack d plus two skip bytes, and pack it as a double d followed by two appropriate fill bytes (00 or 88 ?). Bill N1VUX
  • Comment on Re^4: Unpacking extended-double precision floats

Replies are listed 'Best First'.
Re^5: Unpacking extended-double precision floats
by herveus (Prior) on Nov 30, 2006 at 12:35 UTC
    Howdy!

    If I recall correctly (and I'll be checking the references before I do anything), "double precision" and "extended double precision" have different numbers of bits in the exponent. It's not quite that simple to smush the precision down. I think I go from 64 bits of mantissa to 53 bits of mantissa (but don't hold me to precise numbers here).

    In the end, I should be able to pick the three components apart and Just Do The Math.

    yours,
    Michael
      According to the wikipedia article on double precision floats it has 1 sign bit 11 exponent bits and 52 mantissa bits

      --
      "WHAT CAN THE HARVEST HOPE FOR IF NOT THE CARE OF THE REAPER MAN"
      -- Terry Pratchett, "Reaper Man"

        52-actual bits, but there is also an impled bit in for an effective mantissa of 53-bits.

        The tricky bit[sic] is that in the 64-bit mantissa of the 80-bit animal, there is not an implied bit.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
        Howdy!

        Yep. That's the 64-bit flavor. The 80-bit flavor is 1 sign bit, 15 or more exponent bits, and 64 or more mantissa bits.

        yours,
        Michael