📜  红宝石 |数学 acosh()函数

📅  最后修改于: 2022-05-13 01:54:55.404000             🧑  作者: Mango

红宝石 |数学 acosh()函数

acosh()是 Ruby 中的内置函数,返回以弧度给出的角度的反双曲余弦值。

示例 1

#Ruby program for acosh() function
  
#Assigning values
val1 = 2 val2 = 877 val3 = 432 val4 = 43
  
#Prints the acosh() value
                                      puts Math.acosh(val1)
                                          puts Math.acosh(val2)
                                              puts Math.acosh(val3)
                                                  puts Math.acosh(val4)

输出

1.3169578969248166
7.469653847888966
6.761571429209457
4.454212060602711

示例 2

#Ruby program for acosh() function
  
#Assigning values
val1 = 20 val2 = 83 val3 = 332 val4 = 3
  
#Prints the acosh() value
                                      puts Math.acosh(val1)
                                          puts Math.acosh(val2)
                                              puts Math.acosh(val3)
                                                  puts Math.acosh(val4)

输出

3.6882538673612966
5.111951496643704
6.498279881360139
1.762747174039086

参考:https://devdocs.io/ruby~2.5/cmath#method-i-acosh