⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cosh.c

📁 基于4个mips核的noc设计
💻 C
字号:
/* * lib-src/ansi/math/cosh.c * ANSI/ISO 9899-1990, Section 7.5.3.1. * * double cosh(double x) * Return the hyperbolic cosine of x. * Uses: cosh(x) = 0.5 * (exp(x) + exp(-x)). * * Exceptions: *	EDOM	NaN		x is NaN *	ERANGE	HUGE_VAL	exp(x) or exp(-x) overflows *	none	+Infinity	x is [+-]Infinity */#include "mathlib.h"doublecosh(double x){#if	defined(__IEEE_FP__)	if (_isNaN(x)) {		errno = EDOM;		return x;		/* NaN: domain error, return NaN */	} else if (_isInfinity(x))		return _pInfinity;	/* [+-]Infinity: no error, return +Infinity */#endif	if (x > LN_DBL_MAX || x < LN_DBL_MIN) {		errno = ERANGE;		return HUGE_VAL;	}	x = exp(x);	return 0.5 * (x + 1.0 / x);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -