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

Semrush - keyword research tool

Turn ChatGPT, Claude, Gemini, And CoPilot Into Your Personal Assistant, Business Coach, Content Creator, And More

AFFILIATE MARKETING Your all-in-one performance engine Manage affiliates, creators, and customer referrals in one unified platform—turning every partnership into measurable growth
Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

42,686 questions

55,439 answers

573 users

How to use the cosh() function to get the hyperbolic cosine of a number in Rust

1 Answer

0 votes
fn main() {
    println!("cosh(-1) = {}", f64::cosh(-1.0));
    println!("cosh(1) = {}", f64::cosh(1.0));
    println!("cosh(0) = {}", f64::cosh(0.0));
    println!("cosh(-0) = {}", f64::cosh(-0.0));
    println!("cosh(0.9) = {}", f64::cosh(0.9));
    println!("cosh(PI) = {}", f64::cosh(std::f64::consts::PI));
    println!("cosh(PI * 2) = {}", f64::cosh(std::f64::consts::PI * 2.0));
    println!("cosh(PI / 2) = {}", f64::cosh(std::f64::consts::PI / 2.0));
    println!("cosh(PI / 3) = {}", f64::cosh(std::f64::consts::PI / 3.0));
}

    
    
/*
run:
 
cosh(-1) = 1.5430806348152437
cosh(1) = 1.5430806348152437
cosh(0) = 1
cosh(-0) = 1
cosh(0.9) = 1.4330863854487745
cosh(PI) = 11.591953275521519
cosh(PI * 2) = 267.7467614837482
cosh(PI / 2) = 2.5091784786580567
cosh(PI / 3) = 1.600286857702386
 
*/

 



answered Aug 11, 2024 by avibootz
...