Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^6: Introspection into floats/NV

by ikegami (Patriarch)
on Jun 04, 2025 at 18:05 UTC ( [id://11165250]=note: print w/replies, xml ) Need Help??


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].

  • d isn't defined as an IEEE 754 double-precision float. (That said, it virtually always is.)
  • F isn't defined as a float, and it's unlikely to be one.
  • F isn't defined as an IEEE 754 single-precision float, and it's unlikely to be one.
  • An IEEE 754 single-precision float doesn't have 32 bits of precision.
  • An IEEE 754 double-precision float doesn't have 64 bits of precision.
  • F is probably the same d or something larger, not something smaller.

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11165250]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2025-07-17 09:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.