source: trunk/libs/newlib/src/newlib/libm/complex/conj.c @ 543

Last change on this file since 543 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.1 KB
Line 
1/* $NetBSD: conj.c,v 1.2 2010/09/15 16:11:29 christos Exp $ */
2
3/*
4 * Written by Matthias Drochner <drochner@NetBSD.org>.
5 * Public domain.
6 *
7 * imported and modified include for newlib 2010/10/03
8 * Marco Atzeri <marco_atzeri@yahoo.it>
9 */
10
11/*
12FUNCTION
13        <<conj>>, <<conjf>>---complex conjugate
14
15INDEX
16        conj
17INDEX
18        conjf
19
20SYNOPSIS
21       #include <complex.h>
22       double complex conj(double complex <[z]>);
23       float complex conjf(float complex <[z]>);
24
25
26DESCRIPTION
27        These functions compute the complex conjugate of <[z]>,
28        by reversing the sign of its imaginary part.
29
30        <<conjf>> is identical to <<conj>>, except that it performs
31        its calculations on <<floats complex>>.
32
33RETURNS
34        The conj functions return the complex conjugate value.
35
36PORTABILITY
37        <<conj>> and <<conjf>> are ISO C99
38
39QUICKREF
40        <<conj>> and <<conjf>> are ISO C99
41
42*/
43
44#include <complex.h>
45#include "../common/fdlibm.h"
46
47double complex
48conj(double complex z)
49{
50        double_complex w = { .z = z };
51
52        IMAG_PART(w) = -IMAG_PART(w);
53
54        return (w.z);
55}
Note: See TracBrowser for help on using the repository browser.