Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: PDL 2.058 released

by etj (Deacon)
on Nov 08, 2021 at 23:10 UTC ( [id://11138584]=note: print w/replies, xml ) Need Help??


in reply to Re^3: PDL 2.058 released
in thread PDL 2.058 released

In fact, it's due to a new-ish change in GCC-land; on some versions, tgmath (type-generic maths) works fine for log10, but it seems they've changed that. Furthermore, clog10 (the complex version) is actually a GNU extension rather than part of C99, so I've adjusted ops.pd accordingly (and if there's no clog10 available, you can't do log10 on complex numbers, sorry - but it was ever thus).

I've just released PDL 2.060 which I believe fixes this, so please give it a try.

Replies are listed 'Best First'.
Re^5: PDL 2.058 released
by syphilis (Archbishop) on Nov 09, 2021 at 02:50 UTC
    2.060 tests fine - but I don't know precisely what it was that changed from the earlier versions of gcc/runtime in relation to log10 - nor whether it was a change for the best, or a bug.
    Do you have a simple C script that demonstrates this change ?
    Mingw's complex.h includes clog10() beginning with Strawberry's release of perl-5.30.0 (gcc-8.3.0, runtime 6.0), so it should be available to these Windows builds, and onwards.

    Cheers,
    Rob
      Earlier GCC, this worked and produced the results you'd expect if (like previous me) you didn't properly understand the C99 tgmath, which then stopped working with more recent GCC:
      #include <tgmath.h>
      void main() {
      complex double z = 1.0;
      z = log10(z);
      printf("%f%+fi\n", creal(z), cimag(z));
      }
      
      See https://en.cppreference.com/w/c/numeric/tgmath for more. Note log10 is in the "real-only" section; GCC incorporated it into their "real or imag" tgmath for a while incorporating their own clog10 extension, but then evidently changed their minds. The presence or absence of clog10 is not relevant to log10 working or not with tgmath.
        Earlier GCC, this worked and produced the results you'd expect if (like previous me) you didn't properly understand the C99 tgmath, which then stopped working with more recent GCC:

        Thank you for elaborating.

        Cheers,
        Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-19 16:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found