Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Introspection into floats/NV

by ikegami (Patriarch)
on Jun 03, 2025 at 16:32 UTC ( [id://11165224]=note: print w/replies, xml ) Need Help??


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

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

Replies are listed 'Best First'.
Re^4: Introspection into floats/NV
by LanX (Saint) on Jun 03, 2025 at 16:55 UTC
    > 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
        I think there is a generic formula to calculate these using prime factors.

        But I get your point, seeing the periodic portion in hex would be different.

        While the period's length might be the same, the discrepant becomes only one quarter of what it was.

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2025-07-11 15:36 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.