Last change
on this file since 559 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
|
Rev | Line | |
---|
[444] | 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 | /* |
---|
| 12 | FUNCTION |
---|
| 13 | <<conj>>, <<conjf>>---complex conjugate |
---|
| 14 | |
---|
| 15 | INDEX |
---|
| 16 | conj |
---|
| 17 | INDEX |
---|
| 18 | conjf |
---|
| 19 | |
---|
| 20 | SYNOPSIS |
---|
| 21 | #include <complex.h> |
---|
| 22 | double complex conj(double complex <[z]>); |
---|
| 23 | float complex conjf(float complex <[z]>); |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | DESCRIPTION |
---|
| 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 | |
---|
| 33 | RETURNS |
---|
| 34 | The conj functions return the complex conjugate value. |
---|
| 35 | |
---|
| 36 | PORTABILITY |
---|
| 37 | <<conj>> and <<conjf>> are ISO C99 |
---|
| 38 | |
---|
| 39 | QUICKREF |
---|
| 40 | <<conj>> and <<conjf>> are ISO C99 |
---|
| 41 | |
---|
| 42 | */ |
---|
| 43 | |
---|
| 44 | #include <complex.h> |
---|
| 45 | #include "../common/fdlibm.h" |
---|
| 46 | |
---|
| 47 | double complex |
---|
| 48 | conj(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.