目录

static double asin(double a)

描述 (Description)

java.lang.StrictMath.asin()方法返回值的反正弦值。返回的角度在-pi/2 through pi/2的范围内。 它包括这些案件 -

  • 如果参数为NaN或其绝对值大于1,则结果为NaN。
  • 如果参数为零,则结果为零,其参数符号相同。

声明 (Declaration)

以下是java.lang.StrictMath.asin()方法的声明

public static double asin(double a)

参数 (Parameters)

a - 这是要返回其正弦值的值。

返回值 (Return Value)

此方法返回参数的反正弦值。

异常 (Exception)

NA

例子 (Example)

以下示例显示了java.lang.StrictMath.asin()方法的用法。

package com.iowiki;
import java.lang.*;
public class StrictMathDemo {
   public static void main(String[] args) {
      double d1 = 0.90 , d2 = 5.00, d3 = 0;
      // returns the arc sine of a value
      double dAbsValue = StrictMath.asin(d1); 
      System.out.println("arc sine value of " + d1 + " = " + dAbsValue);
      // returns NaN if argument is NaN or its absolute value is greater than 1
      dAbsValue = StrictMath.asin(d2); 
      System.out.println("arc sine value of " + d2 + " = " + dAbsValue);
      // returns zero if the argument is 0
      dAbsValue = StrictMath.asin(d3); 
      System.out.println("arc sine value of " + d3 + " = " + dAbsValue);    
   }
}

让我们编译并运行上面的程序,这将产生以下结果 -

arc sine value of 0.9 = 1.1197695149986342
arc sine value of 5.0 = NaN
arc sine value of 0.0 = 0.0
↑回到顶部↑
WIKI教程 @2018