Examples of unscaledValue()


Examples of java.math.BigDecimal.unscaledValue()

  public void testConstrBIScale() {
    String a = "1231212478987482988429808779810457634781384756794987";
    BigInteger bA = new BigInteger(a);
    int aScale = 10;
    BigDecimal aNumber = new BigDecimal(bA, aScale);
    assertEquals("incorrect value", bA, aNumber.unscaledValue());
    assertEquals("incorrect scale", aScale, aNumber.scale());
  }

  /**
   * new BigDecimal(char[] value).
View Full Code Here

Examples of java.math.BigDecimal.unscaledValue()

  public void testConstrInt() {
    int a = 732546982;
    String res = "732546982";
    int resScale = 0;
    BigDecimal result = new BigDecimal(a);
    assertEquals("incorrect value", res, result.unscaledValue().toString());
    assertEquals("incorrect scale", resScale, result.scale());
  }

  /**
   * new BigDecimal(int, MathContext).
View Full Code Here

Examples of java.math.BigDecimal.unscaledValue()

    RoundingMode rm = RoundingMode.CEILING;
    MathContext mc = new MathContext(precision, rm);
    String res = "732546982";
    int resScale = 0;
    BigDecimal result = new BigDecimal(a, mc);
    assertEquals("incorrect value", res, result.unscaledValue().toString());
    assertEquals("incorrect scale", resScale, result.scale());
  }

  /**
   * new BigDecimal(long value).
View Full Code Here

Examples of java.math.BigDecimal.unscaledValue()

  public void testConstrLong() {
    long a = 4576578677732546982L;
    String res = "4576578677732546982";
    int resScale = 0;
    BigDecimal result = new BigDecimal(a);
    assertEquals("incorrect value", res, result.unscaledValue().toString());
    assertEquals("incorrect scale", resScale, result.scale());
  }

  /**
   * new BigDecimal(long, MathContext).
View Full Code Here

Examples of java.math.BigDecimal.unscaledValue()

    RoundingMode rm = RoundingMode.CEILING;
    MathContext mc = new MathContext(precision, rm);
    String res = "45766";
    int resScale = -14;
    BigDecimal result = new BigDecimal(a, mc);
    assertEquals("incorrect value", res, result.unscaledValue().toString());
    assertEquals("incorrect scale", resScale, result.scale());
  }

  /**
   * new BigDecimal(String value) when value is not a valid representation of
View Full Code Here

Examples of java.math.BigDecimal.unscaledValue()

  public void testConstrStringExponentIntegerMax() {
    String a = "-238768.787678287e2147483647";
    int aScale = -2147483638;
    BigInteger bA = new BigInteger("-238768787678287");
    BigDecimal aNumber = new BigDecimal(a);
    assertEquals("incorrect value", bA, aNumber.unscaledValue());
    assertEquals("incorrect scale", aScale, aNumber.scale());
  }

  /**
   * new BigDecimal(String value) when exponent is Integer.MIN_VALUE.
View Full Code Here

Examples of java.math.BigDecimal.unscaledValue()

    RoundingMode rm = RoundingMode.CEILING;
    MathContext mc = new MathContext(precision, rm);
    String res = "-23876";
    int resScale = -224;
    BigDecimal result = new BigDecimal(a, mc);
    assertEquals("incorrect value", res, result.unscaledValue().toString());
    assertEquals("incorrect scale", resScale, result.scale());
  }

  /**
   * new BigDecimal(String value); value contains exponent and does not contain
View Full Code Here

Examples of java.math.BigDecimal.unscaledValue()

  public void testConstrStringWithExponentWithoutPoint1() {
    String a = "-238768787678287e214";
    int aScale = -214;
    BigInteger bA = new BigInteger("-238768787678287");
    BigDecimal aNumber = new BigDecimal(a);
    assertEquals("incorrect value", bA, aNumber.unscaledValue());
    assertEquals("incorrect scale", aScale, aNumber.scale());
  }

  /**
   * new BigDecimal(String value); value contains exponent and does not contain
View Full Code Here

Examples of java.math.BigDecimal.unscaledValue()

  public void testConstrStringWithExponentWithoutPoint2() {
    String a = "-238768787678287e-214";
    int aScale = 214;
    BigInteger bA = new BigInteger("-238768787678287");
    BigDecimal aNumber = new BigDecimal(a);
    assertEquals("incorrect value", bA, aNumber.unscaledValue());
    assertEquals("incorrect scale", aScale, aNumber.scale());
  }

  /**
   * new BigDecimal(String value); value contains exponent and does not contain
View Full Code Here

Examples of java.math.BigDecimal.unscaledValue()

  public void testConstrStringWithExponentWithoutPoint3() {
    String a = "238768787678287e-214";
    int aScale = 214;
    BigInteger bA = new BigInteger("238768787678287");
    BigDecimal aNumber = new BigDecimal(a);
    assertEquals("incorrect value", bA, aNumber.unscaledValue());
    assertEquals("incorrect scale", aScale, aNumber.scale());
  }

  /**
   * new BigDecimal(String value); value contains exponent and does not contain
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.