Back
cosh (clj)
(source)function
(cosh x)
Returns the hyperbolic cosine of x, (e^x + e^-x)/2.
If x is ##NaN => ##NaN
If x is ##Inf or ##-Inf => ##Inf
If x is zero => 1.0
See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#cosh-double-
Examples
clojure
(ns clojure.test-clojure.math
(:require
[clojure.test :refer :all]
[clojure.math :as m]))
(deftest test-cosh
(is (NaN? (m/cosh ##NaN)))
(is (= ##Inf (m/cosh ##Inf)))
(is (= ##Inf (m/cosh ##-Inf)))
(is (= 1.0 (m/cosh 0.0))))