clogf(3) (complex.h)

David Schultz das at FreeBSD.ORG
Tue Sep 28 18:22:00 UTC 2010


On Mon, Sep 27, 2010, PÁLI Gábor János wrote:
>  Hello,
> 
> I would like to use the clogf(3) function from complex.h, but it seems
> there is no such function implemented on FreeBSD (8.1-STABLE).  Am I
> missing something or is there any way to work this around?

A simple workaround is something like:

    logf(cabs(z)) + i * cargf(z)

There are a few special cases, e.g., when creal(z) < 0, you have to add
i * copysign(M_PI, cimag(z)), and when creal(z) == 0, it's M_PI/2...


More information about the freebsd-hackers mailing list