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.2 KB
|
Rev | Line | |
---|
[444] | 1 | /* $NetBSD: cimag.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 | <<cimag>>, <<cimagf>>, <<cimagl>>---imaginary part |
---|
| 14 | |
---|
| 15 | INDEX |
---|
| 16 | cimag |
---|
| 17 | INDEX |
---|
| 18 | cimagf |
---|
| 19 | INDEX |
---|
| 20 | cimagl |
---|
| 21 | |
---|
| 22 | SYNOPSIS |
---|
| 23 | #include <complex.h> |
---|
| 24 | double cimag(double complex <[z]>); |
---|
| 25 | float cimagf(float complex <[z]>); |
---|
| 26 | long double cimagl(long double complex <[z]>); |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | DESCRIPTION |
---|
| 30 | These functions compute the imaginary part of <[z]>. |
---|
| 31 | |
---|
| 32 | <<cimagf>> is identical to <<cimag>>, except that it performs |
---|
| 33 | its calculations on <<float complex>>. |
---|
| 34 | |
---|
| 35 | <<cimagl>> is identical to <<cimag>>, except that it performs |
---|
| 36 | its calculations on <<long double complex>>. |
---|
| 37 | |
---|
| 38 | RETURNS |
---|
| 39 | The cimag* functions return the imaginary part value (as a real). |
---|
| 40 | |
---|
| 41 | PORTABILITY |
---|
| 42 | <<cimag>>, <<cimagf>> and <<cimagl>> are ISO C99 |
---|
| 43 | |
---|
| 44 | QUICKREF |
---|
| 45 | <<cimag>>, <<cimagf>> and <<cimagl>> are ISO C99 |
---|
| 46 | |
---|
| 47 | */ |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | #include <complex.h> |
---|
| 51 | #include "../common/fdlibm.h" |
---|
| 52 | |
---|
| 53 | double |
---|
| 54 | cimag(double complex z) |
---|
| 55 | { |
---|
| 56 | double_complex w = { .z = z }; |
---|
| 57 | |
---|
| 58 | return (IMAG_PART(w)); |
---|
| 59 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.