mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-02 18:53:22 +00:00
16 lines
232 B
C
16 lines
232 B
C
|
#include <complex.h>
|
||
|
#include <math.h>
|
||
|
|
||
|
float complex
|
||
|
clog10f(float complex z)
|
||
|
{
|
||
|
float complex w;
|
||
|
float p, rr;
|
||
|
|
||
|
rr = cabsf(z);
|
||
|
p = log10f(rr);
|
||
|
rr = atan2f(cimagf(z), crealf(z)) * (float) M_IVLN10;
|
||
|
w = p + rr * I;
|
||
|
return w;
|
||
|
}
|