PageRenderTime 48ms CodeModel.GetById 24ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

/cln-1.3.2/src/real/transcendental/cl_R_coshsinh.cc

#
C++ | 34 lines | 18 code | 9 blank | 7 comment | 3 complexity | 9d0d0dcd5e6ec361d543cce66b30cd57 MD5 | raw file
Possible License(s): GPL-2.0
 1// cosh_sinh().
 2
 3// General includes.
 4#include "base/cl_sysdep.h"
 5
 6// Specification.
 7#include "cln/real.h"
 8
 9
10// Implementation.
11
12#include "cln/float.h"
13#include "real/cl_R.h"
14
15namespace cln {
16
17const cosh_sinh_t cosh_sinh (const cl_R& x)
18{
19// Methode:
20// x rational -> bei x=0 (1,0) als Ergebnis, sonst x in Float umwandeln.
21// x Float -> bekannt.
22
23	if (rationalp(x)) {
24		DeclareType(cl_RA,x);
25		if (zerop(x)) // x=0 -> (1,0) als Ergebnis
26			return cosh_sinh_t(1,0);
27		return cosh_sinh(cl_float(x)); // sonst in Float umwandeln
28	} else {
29		DeclareType(cl_F,x);
30		return cosh_sinh(x);
31	}
32}
33
34}  // namespace cln