# Ruby code for asin() methodrequire'cmath'# Initialize value
a =0.3584
b =2# Printing result
puts "asin value of a : #{CMath.asin(a)}\n\n"
puts "asin value of b : #{CMath.asin(b)}\n\n"
Ruby
输出
asin value of a :0.3665534738291246
asin value of b :1.5707963267948966-1.3169578969248166i
Ruby
例2 :
# Ruby code for asin() methodrequire'cmath'# Initialize value
a =0
b =-0.247# Printing result
puts "asin value of a : #{CMath.asin(a)}\n\n"
puts "asin value of b : #{CMath.asin(b)}\n\n"
Ruby
输出
asin value of a :0.0
asin value of b :-0.24958310188075922