in reply to Re: Decimal precision issue: Windows vs. Unix
in thread Decimal precision issue: Windows vs. Unix

17 digits of precision is the max for doubles. Are you aware that your linux perl is using long doubles?
  • Comment on Re^2: Decimal precision issue: Windows vs. Unix

Replies are listed 'Best First'.
Re^3: Decimal precision issue: Windows vs. Unix
by syphilis (Archbishop) on Jan 10, 2009 at 01:56 UTC
    Are you aware that your linux perl is using long doubles?

    I don't think it is. For the expression presented in the original post in this thread, on linux (without long double support) I get the same -95.2443654287109, but on the same machine (and OS), when perl has been built with -Duselongdouble, the output is -95.24436542871095.

    Of course, the output of perl -V:archname would tell us for sure.

    Cheers,
    Rob
Re^3: Decimal precision issue: Windows vs. Unix
by gone2015 (Deacon) on Jan 10, 2009 at 01:50 UTC

    No, I'm not aware of it using long doubles. perl -V gives:

    Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
      Platform:
        osname=linux, osvers=2.6.18-92.1.10.el5, archname=x86_64-linux-thread-multi
    ....
        intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
        d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
        ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
        alignbytes=8, prototype=define
    ....
    
    which suggests to me that it's using ordinary 8 byte doubles.

      longdblsize=16
        nvsize=8