in reply to Re^5: Introspection into floats/NV
in thread Introspection into floats/NV

That's completely wrong [Update: except the bit on endianness].

See Mini-Tutorial: Formats for Packing and Unpacking Numbers.

d is a double
It is likely to be an IEEE 754 double-precision float, but it might not be.

f is a float
It is likely to be an IEEE 754 single-precision float, but it might not be.

F is an NV
It is likely to be an IEEE 754 double-precision float.
It is possibly an IEEE 754 quad-precision float.
It's unlikely to be an IEEE 754 single-precision float.
It's conceivable for it to be an Intel 80-bit extended precision float.
It might be none of those.

An IEEE 754 quad-precision float will be 128 bits in size and have 133 bits of precision (or less for subnormals).
An IEEE 754 double-precision float will be 64 bits in size and have 53 bits of precision (or less for subnormals).
An IEEE 754 single-precision float will be 32 bits in size and have 24 bits of precision (or less for subnormals).
An Intel 80-bit extended precision float will be at least 80 bits in size and have 64 bits of precision (or less for subnormals).

Replies are listed 'Best First'.
Re^7: Introspection into floats/NV
by karlgoethebier (Abbot) on Jun 04, 2025 at 19:16 UTC

      Don't play dumb. We might actually come to believe it.

      You didn't use the word "defined", but your post defines the two pack formats (if one can say that of a definition that's completely wrong). That was the whole point of the post.

      And I didn't say what you posted lacked wisdom; I said what you posted is completely wrong.