/* * math.h - User level library definition. * * Author Alain Greiner (2016,2017,2018) * * Copyright (c) UPMC Sorbonne Universites * * This file is part of ALMOS-MKH. * * ALMOS-MKH is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2.0 of the License. * * ALMOS-MKH is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ALMOS-MKH; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MATH_H_ #define MATH_H_ /***************************************************************************************** * This file defines the user level, mathematical functions library. * Most of this code is a modification of the library, developped by Sun * Microsystem Inc in 1993, and ported to the ALMOS-MKH 0S in August 2018. ****************************************************************************************/ /***************************************************************************************** * This function returns the absolute value of the argument. ****************************************************************************************/ double fabs (double x); /***************************************************************************************** * This function returns the remainder of . ****************************************************************************************/ double fmod (double x, double y); /***************************************************************************************** * This function round to the largest integer value not larger than . ****************************************************************************************/ double floor (double x); /***************************************************************************************** * This function round to the smallest integer value not less than . ****************************************************************************************/ double ceil (double x); /***************************************************************************************** * This function returns the sine function of the argument in radian. ****************************************************************************************/ double sin (double x); /***************************************************************************************** * This function returns the cosine function of the argument in radian. ****************************************************************************************/ double cos (double x); /***************************************************************************************** * This function returns the value of raised to the power of . ****************************************************************************************/ double pow (double x, double y); /***************************************************************************************** * This function returns the base-e exponential of . ****************************************************************************************/ double exp (double x); /***************************************************************************************** * This function returns non-zero if is not a number (NaN). ****************************************************************************************/ int isnan (double x); /***************************************************************************************** * This function returns non-zero if is infinite. ****************************************************************************************/ int isfinite(double x); /***************************************************************************************** * These functions return x*(2**n), computed by exponent manipulation. ****************************************************************************************/ double scalbln (double x, long n); double scalbn (double x, int n); /***************************************************************************************** * This function changes the sign of to that of . ****************************************************************************************/ double copysign(double x, double y); /***************************************************************************************** * This function return the integral value nearest to (according to the * prevailing rounding mode) in floating-point format. ****************************************************************************************/ double rint (double x); #endif