Path: blob/master/src/java.base/share/native/libjava/StrictMath.c
41149 views
/*1* Copyright (c) 1994, 2016, 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*/2425#include "jni.h"26#include "fdlibm.h"2728#include "java_lang_StrictMath.h"2930JNIEXPORT jdouble JNICALL31Java_java_lang_StrictMath_cos(JNIEnv *env, jclass unused, jdouble d)32{33return (jdouble) jcos((double)d);34}3536JNIEXPORT jdouble JNICALL37Java_java_lang_StrictMath_sin(JNIEnv *env, jclass unused, jdouble d)38{39return (jdouble) jsin((double)d);40}4142JNIEXPORT jdouble JNICALL43Java_java_lang_StrictMath_tan(JNIEnv *env, jclass unused, jdouble d)44{45return (jdouble) jtan((double)d);46}4748JNIEXPORT jdouble JNICALL49Java_java_lang_StrictMath_asin(JNIEnv *env, jclass unused, jdouble d)50{51return (jdouble) jasin((double)d);52}5354JNIEXPORT jdouble JNICALL55Java_java_lang_StrictMath_acos(JNIEnv *env, jclass unused, jdouble d)56{57return (jdouble) jacos((double)d);58}5960JNIEXPORT jdouble JNICALL61Java_java_lang_StrictMath_atan(JNIEnv *env, jclass unused, jdouble d)62{63return (jdouble) jatan((double)d);64}6566JNIEXPORT jdouble JNICALL67Java_java_lang_StrictMath_log(JNIEnv *env, jclass unused, jdouble d)68{69return (jdouble) jlog((double)d);70}7172JNIEXPORT jdouble JNICALL73Java_java_lang_StrictMath_log10(JNIEnv *env, jclass unused, jdouble d)74{75return (jdouble) jlog10((double)d);76}7778JNIEXPORT jdouble JNICALL79Java_java_lang_StrictMath_sqrt(JNIEnv *env, jclass unused, jdouble d)80{81return (jdouble) jsqrt((double)d);82}8384JNIEXPORT jdouble JNICALL85Java_java_lang_StrictMath_atan2(JNIEnv *env, jclass unused, jdouble d1, jdouble d2)86{87return (jdouble) jatan2((double)d1, (double)d2);88}8990JNIEXPORT jdouble JNICALL91Java_java_lang_StrictMath_IEEEremainder(JNIEnv *env, jclass unused,92jdouble dividend,93jdouble divisor)94{95return (jdouble) jremainder(dividend, divisor);96}9798JNIEXPORT jdouble JNICALL99Java_java_lang_StrictMath_cosh(JNIEnv *env, jclass unused, jdouble d)100{101return (jdouble) jcosh((double)d);102}103104JNIEXPORT jdouble JNICALL105Java_java_lang_StrictMath_sinh(JNIEnv *env, jclass unused, jdouble d)106{107return (jdouble) jsinh((double)d);108}109110JNIEXPORT jdouble JNICALL111Java_java_lang_StrictMath_tanh(JNIEnv *env, jclass unused, jdouble d)112{113return (jdouble) jtanh((double)d);114}115116JNIEXPORT jdouble JNICALL117Java_java_lang_StrictMath_log1p(JNIEnv *env, jclass unused, jdouble d)118{119return (jdouble) jlog1p((double)d);120}121122JNIEXPORT jdouble JNICALL123Java_java_lang_StrictMath_expm1(JNIEnv *env, jclass unused, jdouble d)124{125return (jdouble) jexpm1((double)d);126}127128129