Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/java/lang/StrictMath.c
38829 views
/*1* Copyright (c) 1994, 2003, 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_exp(JNIEnv *env, jclass unused, jdouble d)68{69return (jdouble) jexp((double)d);70}7172JNIEXPORT jdouble JNICALL73Java_java_lang_StrictMath_log(JNIEnv *env, jclass unused, jdouble d)74{75return (jdouble) jlog((double)d);76}7778JNIEXPORT jdouble JNICALL79Java_java_lang_StrictMath_log10(JNIEnv *env, jclass unused, jdouble d)80{81return (jdouble) jlog10((double)d);82}8384JNIEXPORT jdouble JNICALL85Java_java_lang_StrictMath_sqrt(JNIEnv *env, jclass unused, jdouble d)86{87return (jdouble) jsqrt((double)d);88}8990JNIEXPORT jdouble JNICALL91Java_java_lang_StrictMath_cbrt(JNIEnv *env, jclass unused, jdouble d)92{93return (jdouble) jcbrt((double)d);94}9596JNIEXPORT jdouble JNICALL97Java_java_lang_StrictMath_atan2(JNIEnv *env, jclass unused, jdouble d1, jdouble d2)98{99return (jdouble) jatan2((double)d1, (double)d2);100}101102JNIEXPORT jdouble JNICALL103Java_java_lang_StrictMath_pow(JNIEnv *env, jclass unused, jdouble d1, jdouble d2)104{105return (jdouble) jpow((double)d1, (double)d2);106}107108JNIEXPORT jdouble JNICALL109Java_java_lang_StrictMath_IEEEremainder(JNIEnv *env, jclass unused,110jdouble dividend,111jdouble divisor)112{113return (jdouble) jremainder(dividend, divisor);114}115116JNIEXPORT jdouble JNICALL117Java_java_lang_StrictMath_cosh(JNIEnv *env, jclass unused, jdouble d)118{119return (jdouble) jcosh((double)d);120}121122JNIEXPORT jdouble JNICALL123Java_java_lang_StrictMath_sinh(JNIEnv *env, jclass unused, jdouble d)124{125return (jdouble) jsinh((double)d);126}127128JNIEXPORT jdouble JNICALL129Java_java_lang_StrictMath_tanh(JNIEnv *env, jclass unused, jdouble d)130{131return (jdouble) jtanh((double)d);132}133134JNIEXPORT jdouble JNICALL135Java_java_lang_StrictMath_hypot(JNIEnv *env, jclass unused, jdouble x, jdouble y)136{137return (jdouble) jhypot((double)x, (double)y);138}139140141142JNIEXPORT jdouble JNICALL143Java_java_lang_StrictMath_log1p(JNIEnv *env, jclass unused, jdouble d)144{145return (jdouble) jlog1p((double)d);146}147148JNIEXPORT jdouble JNICALL149Java_java_lang_StrictMath_expm1(JNIEnv *env, jclass unused, jdouble d)150{151return (jdouble) jexpm1((double)d);152}153154155