Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Behaviour of int() unexpected

by pryrt (Abbot)
on Mar 10, 2025 at 23:47 UTC ( [id://11164225]=note: print w/replies, xml ) Need Help??


in reply to Re: Behaviour of int() unexpected
in thread Behaviour of int() unexpected

syphilis said,
64-bit precision long double

I checked again, just to make sure:

C:\usr\local\share\github\notepad-plus-plus>perl -V:nvtype nvtype='double'; C:\usr\local\share\github\notepad-plus-plus>perl -V:nvsize nvsize='8';

Double is the 64 bit (8 byte) precision.

"Long double" doesn't seem to have much consistentency in the WP article (80, 96, or 128 bits) (update: though re-reading, I now see that GNU C seems to have chosen 80bit, so that's what I'm now guessing your nvsize will show). I don't have access to a perl with nvtype='long double', so could you double-check the nvsize on your "long double" version?

Replies are listed 'Best First'.
Re^3: Behaviour of int() unexpected
by syphilis (Archbishop) on Mar 11, 2025 at 03:02 UTC
    could you double-check the nvsize on your "long double" version?

    Yes, it's the 80-bit extended precision long double - 1 bit for the sign, 15 bits for the exponent, and 64 bits for the mantissa.
    If it were the IEEE-754 long double, then the one-liner would have returned 894, as for "double" and "__float128".

    If you want to find out which of the various "long double" formats is being honored by your perl, then (assuming perl is not more than about 10 years old) you can run perl -V:longdblkind, which will return a value in the range -1..9.
    The meaning of the returned value is explained in the Config docs:
    "longdblkind" From d_longdbl.U: This variable, if defined, encodes the type of a long double: 0 = double, 1 = "IEEE" 754 128-bit little endian, 2 = "IEEE" 754 128-bit big endian, 3 = x86 80-bit little endian, 4 = x86 80-bit big endian, 5 = double-double 128-bit little endian, 6 = double-double 128-bit big endian, 7 = 128-bit mixed-endian double-double (64-bit LEs in "BE"), 8 = 128-bit mixed-endian double-double (64-bit BEs in "LE"), 9 = 128-bit "PDP"-style mixed-endian long doubles, -1 = unknown format +.
    Cheers,
    Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2026-03-08 04:15 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.