Package erjang

Examples of erjang.EDouble


   
    String s = v.stringValue();
    Matcher m = float_pattern.matcher(s);
    if (m.matches()) {
      String ss = m.group(1);
      EDouble floatval = ERT.box( Double.parseDouble(ss) );
      ESeq rest;
      if (ss.length() == s.length()) {
        rest = ERT.NIL;
      } else {
        rest = new EString(s.substring(ss.length()));
View Full Code Here


    EInteger i;
    if ((i = testInteger()) != null)
        return i;

    EDouble d;
    if ((d = testFloat()) != null)
        return d;

    return null;
  }
View Full Code Here

  }

  @Override
  public EDouble testFloat() {
    if (real_object instanceof Double) {
      return new EDouble(((Double) real_object).doubleValue());
    }
    return null;
  }
View Full Code Here

  @BIF
  public static ENumber sin(EObject val)
  {
    ENumber num;
    if ((num = val.testNumber()) != null) {
      return new EDouble(Math.sin(num.doubleValue()));
    }
    throw ERT.badarg(val);
  }
View Full Code Here

  @BIF
  public static ENumber cos(EObject val)
  {
    ENumber num;
    if ((num = val.testNumber()) != null) {
      return new EDouble(Math.cos(num.doubleValue()));
    }
    throw ERT.badarg(val);
  }
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);
  }
View Full Code Here

  }

  @BIF
  public static EDouble pi()
  {
    return new EDouble(Math.PI);
  }
View Full Code Here

    throw ERT.badarg(val);
  }

  public static EDouble boxIfValid(double value, EObject arg) {
    if (Double.isNaN(value) || Double.isInfinite(value)) throw ERT.badarg(arg);
    else return new EDouble(value);
  }
View Full Code Here

    @Override
    public Float testFloat() {return this;}

    @Override
    public EObject literalValue() {return new EDouble(value);}
View Full Code Here

    @Override
    public EObject literalValue() {return new EDouble(value);}

    public EObject toSymbolic() {
      return ETuple.make(FLOAT_ATOM, new EDouble(value));
    }
View Full Code Here

TOP

Related Classes of erjang.EDouble

Copyright © 2018 www.massapicom. 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.