Package java.math

Examples of java.math.BigInteger


  }

  public static Object parseBigInteger(String number, String format)
    throws FunctionExecutionException {
    Number bigIntegerNum = parseNumberHelper(number, format);
    return new BigInteger(bigIntegerNum.toString());
  }
View Full Code Here


    private Object consumeMsg(BigInteger object, Element cellElement) throws JDOMException {

        // -----------------------
        // Process the element ...
        // -----------------------
        BigInteger result;
        try {
            result = new BigInteger(cellElement.getTextTrim());
        } catch ( NumberFormatException e ) {
            throw new JDOMException("Unable to parse the value for " + cellElement.getName() + //$NON-NLS-1$
                                    " element: " + cellElement.getTextTrim(), e); //$NON-NLS-1$
        }
        return result;
View Full Code Here

    @Test public void testInvokeMinus4() {
        helpInvokeMethod("-", new Object[] { new Double(3), new Double(2) }, new Double(1)); //$NON-NLS-1$
    }

    @Test public void testInvokeMinus5() {
        helpInvokeMethod("-", new Object[] { new BigInteger("3"), new BigInteger("2") }, new BigInteger("1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    }
View Full Code Here

    @Test public void testInvokeMultiply4() {
        helpInvokeMethod("*", new Object[] { new Double(3), new Double(2) }, new Double(6)); //$NON-NLS-1$
    }

    @Test public void testInvokeMultiply5() {
        helpInvokeMethod("*", new Object[] { new BigInteger("3"), new BigInteger("2") }, new BigInteger("6")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    }
View Full Code Here

    @Test public void testInvokeDivide4() {
        helpInvokeMethod("/", new Object[] { new Double(3), new Double(2) }, new Double(1.5)); //$NON-NLS-1$
    }

    @Test public void testInvokeDivide5() {
        helpInvokeMethod("/", new Object[] { new BigInteger("3"), new BigInteger("2") }, new BigInteger("1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    }
View Full Code Here

    @Test public void testInvokeAbs4() {
        helpInvokeMethod("abs", new Object[] { new Double(-3) }, new Double(3)); //$NON-NLS-1$
    }

    @Test public void testInvokeAbs5() {
        helpInvokeMethod("abs", new Object[] { new BigInteger("-3") }, new BigInteger("3")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
View Full Code Here

  @Test public void testInvokeParseFloat() {
    helpInvokeMethod("parseFloat", new Object[] {new String("1234.56"), new String("####.###")}, new Float(1234.56));   //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
  }
 
  @Test public void testInvokeParseBigInteger() {
    helpInvokeMethod("parseBigInteger", new Object[] {new String("12345678"), new String("###,###")}, new BigInteger("12345678"));   //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
  }
View Full Code Here

  @Test public void testInvokeFormatFloat() {
    helpInvokeMethod("formatFloat", new Object[] {new Float(1234.67), new String("###.###")}, "1234.67");   //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
  }
 
  @Test public void testInvokeFormatBigInteger() {
    helpInvokeMethod("formatBigInteger", new Object[] {new BigInteger("45"), new String("###.###")}, "45");   //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
  }
View Full Code Here

                       
                        new List[] { Arrays.asList(new Object[] {
                            ts,
                            new Double(Double.NEGATIVE_INFINITY),
                            new Float(Float.POSITIVE_INFINITY),
                            new BigInteger("100"), //$NON-NLS-1$
                            new BigInteger("100"), //$NON-NLS-1$
                            ts,
                            new BigInteger("100"), //$NON-NLS-1$
                            ts,
                            "1" //$NON-NLS-1$
                                                   })});
       
       
View Full Code Here

      SimpleMetaType st = (SimpleMetaType) type;

      if (SimpleMetaType.BIGDECIMAL.equals(st)) {
        return new SimpleValueSupport(st, new BigDecimal(value));
      } else if (SimpleMetaType.BIGINTEGER.equals(st)) {
        return new SimpleValueSupport(st, new BigInteger(value));
      } else if (SimpleMetaType.BOOLEAN.equals(st)) {
        return new SimpleValueSupport(st, Boolean.valueOf(value));
      } else if (SimpleMetaType.BOOLEAN_PRIMITIVE.equals(st)) {
        return new SimpleValueSupport(st, Boolean.valueOf(value)
            .booleanValue());
View Full Code Here

TOP

Related Classes of java.math.BigInteger

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.