Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,907 questions

51,839 answers

573 users

How to use the math.Cosh() function to get the hyperbolic cosine of a number in Go

1 Answer

0 votes
package main

import (
	"fmt"
	"math"
)

func main() {
	fmt.Println("math.Cosh(-1) =", math.Cosh(-1))
	fmt.Println("math.Cosh(1) =", math.Cosh(1))
	fmt.Println("math.Cosh(0) =", math.Cosh(0))
	fmt.Println("math.Cosh(-0) =", math.Cosh(-0))
	fmt.Println("math.Cosh(0.9) =", math.Cosh(0.9))
	fmt.Println("math.Cosh(math.Pi) =", math.Cosh(math.Pi))
	fmt.Println("math.Cosh(math.Pi * 2) =", math.Cosh(math.Pi*2))
	fmt.Println("math.Cosh(math.Pi / 2) =", math.Cosh(math.Pi/2))
	fmt.Println("math.Cosh(math.Pi / 3) =", math.Cosh(math.Pi/3))
}


/*
run:

math.Cosh(-1) = 1.5430806348152437
math.Cosh(1) = 1.5430806348152437
math.Cosh(0) = 1
math.Cosh(-0) = 1
math.Cosh(0.9) = 1.4330863854487745
math.Cosh(math.Pi) = 11.591953275521519
math.Cosh(math.Pi * 2) = 267.7467614837482
math.Cosh(math.Pi / 2) = 2.5091784786580567
math.Cosh(math.Pi / 3) = 1.6002868577023865

*/

 



answered Aug 11, 2024 by avibootz
...