Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangFloat


    }

    @SuppressWarnings("boxing")
    @Test
    public void cvtFloatOk_1() throws SignatureException {
        test(3.14f, "d", new OtpErlangFloat(3.14f));
    }
View Full Code Here


            functionName = "simi_expr_search_in_dirs_eclipse";
        }
        result = backend.callWithoutParser(WranglerRefactoringBackend.UNLIMITED_TIMEOUT,
                functionName, "sxxxxi", sel.getFilePath(), sel.getSelectionRange()
                        .getStartPos(), sel.getSelectionRange().getEndPos(),
                new OtpErlangFloat(simScore), sel.getSearchPath(), GlobalParameters
                        .getTabWidth());

        if (result.isOk()) {
            return new SimilarExpressionSearchParser(result.getValue());
        }
View Full Code Here

    private static OtpErlangObject cvtNumber(final Object obj, final Signature type)
            throws SignatureException {
        if (obj instanceof Float) {
            if (type.kind == 'd') {
                return new OtpErlangFloat((Float) obj);
            }
            failConversion(obj, type);
        } else if (obj instanceof Double) {
            if (type.kind == 'd') {
                return new OtpErlangDouble((Double) obj);
View Full Code Here

        }
        if (obj instanceof BigInteger) {
            return new OtpErlangLong((BigInteger) obj);
        }
        if (obj instanceof Float) {
            return new OtpErlangFloat((Float) obj);
        }
        if (obj instanceof Double) {
            return new OtpErlangDouble((Double) obj);
        }
        if (obj instanceof Boolean) {
View Full Code Here

        j++;
      }
      props[j] = new OtpErlangTuple(new OtpErlangObject[] {
          new OtpErlangAtom("`score"),
          Float.isNaN(hits[i].score) ? new OtpErlangAtom("undefined")
              : new OtpErlangFloat(hits[i].score) });
      values[i] = new OtpErlangList(props);
    }
    OtpErlangList valuesAsList = new OtpErlangList(values);
    return valuesAsList;
  }
View Full Code Here

  private OtpErlangObject parseField(Fieldable field) {
    switch (getFieldType(field.name())) {
    case DOUBLE:
      return new OtpErlangDouble(Double.parseDouble(field.stringValue()));
    case FLOAT:
      return new OtpErlangFloat(Float.parseFloat(field.stringValue()));
    case INT:
      return new OtpErlangInt(Integer.parseInt(field.stringValue()));
    case LONG:
      return new OtpErlangLong(Long.parseLong(field.stringValue()));
    case ATOM:
View Full Code Here

    final OtpErlangObject[] docValues;
    float[] origs = FieldCache.DEFAULT.getFloats(reader, this.fieldName);
    docValues = new OtpErlangObject[origs.length];
    for (int i = 0; i < origs.length; i++) {
      if (origs[i] != Float.NaN) {
        docValues[i] = new OtpErlangFloat(origs[i]);
      } else {
        docValues[i] = new OtpErlangAtom("undefined");
      }
    }
    return docValues;
View Full Code Here

    } else if (obj instanceof Character) {
      return new OtpErlangChar((Character) obj);
    } else if (obj instanceof Double) {
      return new OtpErlangDouble((Double) obj);
    } else if (obj instanceof Float) {
      return new OtpErlangFloat((Float) obj);
    } else if (obj instanceof Integer) {
      return new OtpErlangInt((Integer) obj);
    } else if (obj instanceof Long) {
      return new OtpErlangLong((Long) obj);
    } else if (obj instanceof Short) {
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangFloat

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.