1181377Sdas/*- 2181377Sdas * Copyright (c) 2008 David Schultz <das@FreeBSD.ORG> 3181377Sdas * All rights reserved. 4181377Sdas * 5181377Sdas * Redistribution and use in source and binary forms, with or without 6181377Sdas * modification, are permitted provided that the following conditions 7181377Sdas * are met: 8181377Sdas * 1. Redistributions of source code must retain the above copyright 9181377Sdas * notice, this list of conditions and the following disclaimer. 10181377Sdas * 2. Redistributions in binary form must reproduce the above copyright 11181377Sdas * notice, this list of conditions and the following disclaimer in the 12181377Sdas * documentation and/or other materials provided with the distribution. 13181377Sdas * 14181377Sdas * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15181377Sdas * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16181377Sdas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17181377Sdas * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18181377Sdas * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19181377Sdas * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20181377Sdas * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21181377Sdas * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22181377Sdas * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23181377Sdas * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24181377Sdas * SUCH DAMAGE. 25181377Sdas */ 26181377Sdas 27181377Sdas#include <sys/cdefs.h> 28181377Sdas__FBSDID("$FreeBSD: releng/10.2/lib/msun/src/s_cprojf.c 284810 2015-06-25 13:01:10Z tijl $"); 29181377Sdas 30181377Sdas#include <complex.h> 31181377Sdas#include <math.h> 32181377Sdas 33181377Sdas#include "math_private.h" 34181377Sdas 35181377Sdasfloat complex 36181377Sdascprojf(float complex z) 37181377Sdas{ 38181377Sdas 39181377Sdas if (!isinf(crealf(z)) && !isinf(cimagf(z))) 40181377Sdas return (z); 41181377Sdas else 42284810Stijl return (CMPLXF(INFINITY, copysignf(0.0, cimagf(z)))); 43181377Sdas} 44