s_cimagf.c revision 189803
118334Speter/*-
218334Speter * Copyright (c) 2004 Stefan Farfeleder
390075Sobrien * All rights reserved.
4132718Skan *
518334Speter * Redistribution and use in source and binary forms, with or without
6132718Skan * modification, are permitted provided that the following conditions
718334Speter * are met:
8132718Skan * 1. Redistributions of source code must retain the above copyright
918334Speter *    notice, this list of conditions and the following disclaimer.
1018334Speter * 2. Redistributions in binary form must reproduce the above copyright
1118334Speter *    notice, this list of conditions and the following disclaimer in the
1218334Speter *    documentation and/or other materials provided with the distribution.
13132718Skan *
1418334Speter * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1518334Speter * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1618334Speter * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1718334Speter * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
1818334Speter * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19132718Skan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20169689Skan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21169689Skan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2218334Speter * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2318334Speter * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2418334Speter * SUCH DAMAGE.
2550397Sobrien *
26132718Skan * $FreeBSD: head/lib/msun/src/s_cimagf.c 189803 2009-03-14 18:24:15Z das $
27132718Skan */
2818334Speter
2918334Speter#include <complex.h>
3018334Speter#include "math_private.h"
3118334Speter
3218334Speterfloat
3350397Sobriencimagf(float complex z)
3490075Sobrien{
3590075Sobrien	const float_complex z1 = { .f = z };
3618334Speter
3752284Sobrien	return (IMAGPART(z1));
3852284Sobrien}
3952284Sobrien