s_cimagl.c revision 189803
1129864Sstefanf/*- 2129864Sstefanf * Copyright (c) 2004 Stefan Farfeleder 3129864Sstefanf * All rights reserved. 4129864Sstefanf * 5129864Sstefanf * Redistribution and use in source and binary forms, with or without 6129864Sstefanf * modification, are permitted provided that the following conditions 7129864Sstefanf * are met: 8129864Sstefanf * 1. Redistributions of source code must retain the above copyright 9129864Sstefanf * notice, this list of conditions and the following disclaimer. 10129864Sstefanf * 2. Redistributions in binary form must reproduce the above copyright 11129864Sstefanf * notice, this list of conditions and the following disclaimer in the 12129864Sstefanf * documentation and/or other materials provided with the distribution. 13129864Sstefanf * 14129864Sstefanf * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15129864Sstefanf * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16129864Sstefanf * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17129864Sstefanf * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 18129864Sstefanf * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19129864Sstefanf * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20129864Sstefanf * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21129864Sstefanf * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22129864Sstefanf * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23129864Sstefanf * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24129864Sstefanf * SUCH DAMAGE. 25129864Sstefanf * 26129864Sstefanf * $FreeBSD: head/lib/msun/src/s_cimagl.c 189803 2009-03-14 18:24:15Z das $ 27129864Sstefanf */ 28129864Sstefanf 29129864Sstefanf#include <complex.h> 30189803Sdas#include "math_private.h" 31129864Sstefanf 32129864Sstefanflong double 33129864Sstefanfcimagl(long double complex z) 34129864Sstefanf{ 35189803Sdas const long_double_complex z1 = { .f = z }; 36181374Sdas 37189803Sdas return (IMAGPART(z1)); 38129864Sstefanf} 39