Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

How do I use "Long Doubles" in perl?

by cnd (Acolyte)
on May 19, 2018 at 14:46 UTC ( #1214916=perlquestion: print w/replies, xml ) Need Help??

cnd has asked for the wisdom of the Perl Monks concerning the following question:

My perl has them:
#perl -e 'use Config;print "long doubles\n" if $Config{d_longdbl} eq " +define";' long doubles
But they are not default:-
# perl -e 'use Config;if ($Config{uselongdouble} eq "define") {print " +long doubles by default\n";} else {print "not default? How to use???\ +n"}' not default? How to use???
So how do I force their use?

I do not want to use external modules, and yes, I know all about base-2 and float precision.

Replies are listed 'Best First'.
Re: How do I use "Long Doubles" in perl?
by dave_the_m (Monsignor) on May 19, 2018 at 15:34 UTC
    d_longdbl merely means that Configure probed the C library on the build system and found that the ldexpl() function is present.

    uselongdouble means that your perl was configured and built with Configure -Duselongdouble so that the floating point variables perl uses are long double.


      Ahh - interesting. Thanks! So d_longdbl is more-or-less a pointless indicator, since the missing "uselongdouble" indicates that even though it existed, it was not incorporated at compile time.

      Shame. Might have been nice to use - the uncertainty of major breakage dampens my desire to do the rebuild unfortunately... it's on an important business system...

        the uncertainty of major breakage dampens my desire to do the rebuild unfortunately

        I think that such caution is unwarranted.
        If you do the rebuild with -Duselongdouble and the build still passes its tests, then there is no major breakage.
        As regards minor breakages (ie errors not picked up by the test suite) - they are just as likely to be present in the "double" builds as in the "long double" builds.

Re: How do I use "Long Doubles" in perl?
by Tux (Canon) on May 20, 2018 at 08:05 UTC
Re: How do I use "Long Doubles" in perl?
by BrowserUk (Patriarch) on May 19, 2018 at 14:50 UTC

    You reconfigure and rebuild Perl.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1214916]
Approved by davies
Front-paged by haukex
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2022-12-04 09:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found