Path: blob/master/src/java.desktop/share/native/libmlib_image/mlib_SysMath.h
41149 views
/*1* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/242526#ifndef MLIB_SYSMATH_H27#define MLIB_SYSMATH_H2829#include <math.h>30#ifdef _MSC_VER31#define M_PI 3.1415926535897932384632#define M_1_PI 0.3183098861837906715433#endif /* _MSC_VER */3435#define mlib_acos acos36#define mlib_sin sin37#define mlib_cos cos38#define mlib_fabs fabs39#define mlib_ceil ceil4041#ifdef MLIB_LIBCAFEMATH4243#include <stdlib.h>4445#define mlib_sqrt mlib_sqrt_cafe46#define mlib_sinf sinf47#define mlib_cosf cosf48void mlib_sincosf (float x, float *s, float *c);49#define mlib_sqrtf mlib_sqrtf_cafe50#define mlib_fabsf fabsf5152double mlib_sqrt_cafe (double x);53float mlib_sqrtf_cafe (float x);5455#else5657#define mlib_sqrt sqrt5859#define mlib_sinf (float) sin60#define mlib_cosf (float) cos61void mlib_sincosf (float x, float *s, float *c);62#define mlib_sqrtf (float) sqrt63#define mlib_fabsf (float) fabs6465#endif /* MLIB_LIBCAFEMATH */666768/* internal mathematical functions */6970double mlib_sincospi(double x, double *co);71double mlib_atan2i (int y, int x);72int mlib_ilogb (double x);7374#endif /* MLIB_SYSMATH_H */757677