Package erjang

Examples of erjang.ENumber.doubleValue()


  @BIF
  public static EDouble exp(EObject val)
  {
    ENumber num;
    if ((num = val.testNumber()) != null) {
      return boxIfValid(Math.exp(num.doubleValue()), val);
    }
    throw ERT.badarg(val);
  }

  @BIF
View Full Code Here


  @BIF
  public static EDouble log(EObject val)
  {
    ENumber num;
    if ((num = val.testNumber()) != null) {
      return boxIfValid(Math.log(num.doubleValue()), val);
    }
    throw ERT.badarg(val);
  }

  @BIF
View Full Code Here

  @BIF
  public static ENumber log10(EObject val)
  {
    ENumber num;
    if ((num = val.testNumber()) != null) {
      return boxIfValid(Math.log10(num.doubleValue()), val);
    }
    throw ERT.badarg(val);
  }

  @BIF
View Full Code Here

  public static EDouble atan2(EObject val1, EObject val2)
  {
    ENumber num1, num2;
    if ((num1 = val1.testNumber()) != null
      && (num2 = val2.testNumber()) != null) {
      return new EDouble(Math.atan2(num1.doubleValue(), num2.doubleValue()));
    }
    throw ERT.badarg(val1, val2);
  }

  @BIF
View Full Code Here

  @BIF
  public static EDouble sqrt(EObject val)
  {
    ENumber num;
    if ((num = val.testNumber()) != null) {
      return boxIfValid(Math.sqrt(num.doubleValue()), val);
    }
    throw ERT.badarg(val);
  }

  public static EDouble boxIfValid(double value, EObject arg) {
View Full Code Here

  static public ENumber divide$p(EObject v1, EObject v2) {
    ENumber n1;
    if ((n1 = v1.testNumber()) != null) {
      ENumber n2;
      if ((n2 = v2.testNumber()) != null) {
        if (n2.doubleValue() == 0.0)
          return null;
        return n1.divide(v2);
      }
    }
    return null;
View Full Code Here

  }
  @BIF(name = "float")
  static public EDouble float$n(EObject v) {
    ENumber n = v.testNumber();
    if (n==null) throw ERT.badarg(v);
    return ERT.box(n.doubleValue());
  }

  @BIF(name = "float", type=Type.GUARD)
  static public EDouble float$g(EObject v) {
    return v.testFloat();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.