Package java.math

Examples of java.math.BigInteger.doubleValue()


                return makeBI(tc, biType, base.pow(exponent.intValue()));
            }
        }
        else {
            double fBase = base.doubleValue();
            double fExponent = exponent.doubleValue();
            SixModelObject result = nType.st.REPR.allocate(tc, nType.st);
            result.set_num(tc, Math.pow(fBase, fExponent));
            return result;
        }
    }
View Full Code Here


            setCellValueForDouble(cell, value.doubleValue());
            return true;
        }
        if(valueAsObj instanceof BigInteger) {
            BigInteger value = (BigInteger) valueAsObj;
            setCellValueForDouble(cell, value.doubleValue());
            return true;
        }
        if(valueAsObj instanceof Long) {
            Long value = (Long) valueAsObj;
            setCellValueForDouble(cell, (double)value);
View Full Code Here

        String expression = fd.getOperands();
        JEP expressionParser = new JEP();
       
       
        if PropertiesUtil.isEmpty(expression) ) {
            return raw.doubleValue();
        }
      
       
        if (expression.indexOf('[') != -1 ) {
            // this is a look up expresion
View Full Code Here

    {
        public Number compute(Number d1, Number d2)
        {
            BigInteger b1 = (BigInteger) d1;
            BigInteger b2 = (BigInteger) d2;
            if (b2.doubleValue() == 0)
            {
                return null;
            }
            return b1.divide(b2);
        }
View Full Code Here

        public Number compute(Number d1, Number d2)
        {
            BigInteger s1 = convOne.coerceBoxedBigInt(d1);
            BigInteger s2 = convTwo.coerceBoxedBigInt(d2);
            if (s2.doubleValue() == 0)
            {
                return null;
            }
            return s1.divide(s2);
        }
View Full Code Here

         }
      }
      else if(typeCode == XS_UNSIGNEDLONG)
      {
         BigInteger d = new BigInteger(value);
         if(d.doubleValue() < 0 || d.doubleValue() > 18446744073709551615D)
         {
            throw new JBossXBValueFormatException("Invalid unsignedLong value: " + value);
         }
         result = d;
      }
View Full Code Here

         }
      }
      else if(typeCode == XS_UNSIGNEDLONG)
      {
         BigInteger d = new BigInteger(value);
         if(d.doubleValue() < 0 || d.doubleValue() > 18446744073709551615D)
         {
            throw new JBossXBValueFormatException("Invalid unsignedLong value: " + value);
         }
         result = d;
      }
View Full Code Here

         result = u.toString();
      }
      else if(typeCode == XS_UNSIGNEDLONG)
      {
         BigInteger d = (BigInteger)value;
         if (d.doubleValue() < 0 || d.doubleValue() > 18446744073709551615D)
         {
            throw new JBossXBValueFormatException("Invalid unsignedLong value: " + value);
         }
         result = d.toString();
      }
View Full Code Here

         result = u.toString();
      }
      else if(typeCode == XS_UNSIGNEDLONG)
      {
         BigInteger d = (BigInteger)value;
         if (d.doubleValue() < 0 || d.doubleValue() > 18446744073709551615D)
         {
            throw new JBossXBValueFormatException("Invalid unsignedLong value: " + value);
         }
         result = d.toString();
      }
View Full Code Here

    assertTrue("the bigInteger equivalent of -29830.989 is wrong", result
        .toString().equals("-29830"));
    sub1 = new BigDecimal(-2837E10);
    result = sub1.toBigInteger();
    assertTrue("the bigInteger equivalent of -2837E10 is wrong", result
        .doubleValue() == -2837E10);
    sub1 = new BigDecimal(2.349E-10);
    result = sub1.toBigInteger();
    assertTrue("the bigInteger equivalent of 2.349E-10 is wrong", result
        .equals(BigInteger.ZERO));
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.