Dies ist die Adaption der Excel Funktion COSHYP()
DECLARE @coshyp FLOAT
SET @coshyp=1
SELECT
(POWER(EXP(1),@coshyp) +
POWER(EXP(1),-@coshyp) )/2
-----------------------------------------------------
1.5430806348152437
(1 row(s) affected)
Oder die Funktionsvariante:
CREATE FUNCTION dbo.hypcos (@coshyp FLOAT)
RETURNS FLOAT
AS
BEGIN
RETURN ( POWER(EXP(1),@coshyp) + POWER(EXP(1),-@coshyp) )/2
END
GO
SELECT dbo.hypcos(1)
DROP FUNCTION dbo.hypcos
-----------------------------------------------------
1.5430806348152437
(1 row(s) affected)