Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Introspection into floats/NV

by LanX (Saint)
on Jun 03, 2025 at 16:17 UTC ( [id://11165223]=note: print w/replies, xml ) Need Help??


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

Thanks, the second unpack is a good workaround! :)

printf "%a" should hopefully handle all edge cases.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^3: Introspection into floats/NV
by ikegami (Patriarch) on Jun 03, 2025 at 16:32 UTC

    I wrote this before %a was introduced. But %a produces scientific notation, whereas the above doesn't.

      > But %a produces scientific notation, whereas the above doesn't.

      my issue with %a is rather that it's called "hex float" but the exponent is decimal ... LOL.

      I'm happy that it exists anyway, since different builds can have other floats configured, plattforms have various endianness too.

      Furthermore it's a valid number format in Perl.

      DB<18> say 0x1p+10 - 1 1023

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      see Wikisyntax for the Monastery

        I was using it to find the periodic portion.

        0.1 = 0.00011001100110011001100110011001100110011001100110011010 ____ = 0.00011

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2026-03-07 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.