Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangDouble


    }

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


        double parsingResult = Double.parseDouble(textToParse);
        if (Double.isInfinite(parsingResult)
            || Double.isNaN(parsingResult))
          throw new IllegalArgumentException(
              "the number parsed cannot be represented as a double");
        result = new OtpErlangDouble(parsingResult);

      }
      return result;
    }
View Full Code Here

    @Override
    public void dump(OtpErlangObject arg, StringBuffer resultHolder) {
      assert (arg instanceof OtpErlangDouble)
          || (arg instanceof OtpErlangFloat);
      if (arg instanceof OtpErlangDouble) {
        OtpErlangDouble doubleValue = (OtpErlangDouble) arg;
        resultHolder.append(doubleValue.doubleValue());
      } else if (arg instanceof OtpErlangFloat) {
        OtpErlangDouble doubleValue = (OtpErlangDouble) arg;
        resultHolder.append(doubleValue.doubleValue());
      }
    }
View Full Code Here

        double parsingResult = Double.parseDouble(textToParse);
        if (Double.isInfinite(parsingResult)
            || Double.isNaN(parsingResult))
          throw new IllegalArgumentException(
              "the number parsed cannot be represented as a double");
        result = new OtpErlangDouble(parsingResult);

      }
      return result;
    }
View Full Code Here

    @Override
    public void dump(OtpErlangObject arg, StringBuffer resultHolder) {
      assert (arg instanceof OtpErlangDouble)
          || (arg instanceof OtpErlangFloat);
      if (arg instanceof OtpErlangDouble) {
        OtpErlangDouble doubleValue = (OtpErlangDouble) arg;
        resultHolder.append(doubleValue.doubleValue());
      } else if (arg instanceof OtpErlangFloat) {
        OtpErlangDouble doubleValue = (OtpErlangDouble) arg;
        resultHolder.append(doubleValue.doubleValue());
      }
    }
View Full Code Here

  }
 
  @Test
  public void testToString9()
  {
    Assert.assertEquals("-2.340000138101317E-10",ErlangLabel.dumpErlangObject(new OtpErlangDouble(-2.34e-10f)));
  }
View Full Code Here

  }
 
  @Test
  public void testToString10()
  {
    Assert.assertEquals("-2.3399999141693115",ErlangLabel.dumpErlangObject(new OtpErlangDouble(-2.34f)));
  }
View Full Code Here

  }
 
  @Test
  public void testToString11()
  {
    Assert.assertEquals("-2.34E-210",ErlangLabel.dumpErlangObject(new OtpErlangDouble(-2.34e-210)));
  }
View Full Code Here

 
  @Test
  public void testParse6a()
  {
    String text = " 458888.5";
    OtpErlangDouble number = (OtpErlangDouble)ErlangLabel.parseText(text);
    Assert.assertEquals(458888.5,number.doubleValue(),Configuration.fpAccuracy);
    Assert.assertEquals("458888.5",ErlangLabel.dumpErlangObject(runner.evaluateString(text)));
  }
View Full Code Here

 
  @Test
  public void testParse6b()
  {
    String text = " 458888.5e0 ";
    OtpErlangDouble number = (OtpErlangDouble)ErlangLabel.parseText(text);
    Assert.assertEquals(458888.5,number.doubleValue(),Configuration.fpAccuracy);
    Assert.assertEquals("458888.5",ErlangLabel.dumpErlangObject(runner.evaluateString(text)));
  }
View Full Code Here

TOP

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

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.