File: clog10f.c

package info (click to toggle)
picolibc 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 27,124 kB
  • sloc: ansic: 266,005; asm: 22,255; perl: 2,388; sh: 1,016; python: 994; exp: 282; makefile: 94; xml: 39
file content (16 lines) | stat: -rw-r--r-- 296 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Copyright (c) 2016 Yaakov Selkowitz <yselkowi@redhat.com> */
#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;
}