Package java.math

Examples of java.math.BigInteger.doubleValue()


         }
      }
      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

          obj = new Integer((int) n);
        }
      } else if (expr.realQ() || expr.rationalQ()) {
        /* return all real numbers as doubles */
        BigDecimal val = expr.asBigDecimal();
        obj = new Double(val.doubleValue());
      } else if (expr.stringQ() || expr.symbolQ()) {
        obj = expr.asString();
      } else if (ruleListQ(expr)) {
        obj = exprToMap(expr);
      } else if (expr.listQ()) {
View Full Code Here

      final int cardinality = cardinality(column);
      if (cardinality > 1) {
        n = n.multiply(BigInteger.valueOf(cardinality));
      }
    }
    final double nn = n.doubleValue();
    final double f = getFactRowCount();
    final double a = (nn - 1d) / nn;
    if (a == 1d) {
      // A under-flows if nn is large.
      return f;
View Full Code Here

            }
        }
        // Compute the mean square error:
        double mse = (tr.getSum() + tg.getSum() + tb.getSum() + ta.getSum()) / (i1.getWidth() * i1.getHeight() * cc);
        log.info("Mean square error: " + mse);
        log.info("Mean square error 2: " + (br.doubleValue() + bg.doubleValue() + bb.doubleValue() + ba.doubleValue()) / (i1.getWidth() * i1.getHeight() * cc) );
        if (mse == 0) {
            log.warning("mse == 0 and so psnr will be infinity!");
        }
        // Also do the BigInteger calculation:
        System.out.println("Got: br = "+br+", tr = "+tr.getSum());
View Full Code Here

     
      BigInteger asBigInt = convertLongToUlong(valueAsLong);
     
      // TODO: Check for overflow
     
      return asBigInt.doubleValue();
    case MysqlDefs.FIELD_TYPE_FLOAT:
      return (double) getNativeFloat(columnIndex + 1);
    case MysqlDefs.FIELD_TYPE_BIT:
      return getNumericRepresentationOfSQLBitType(columnIndex + 1);
    default:
View Full Code Here

                setCellValueForDouble(cell, value.doubleValue());
                return;
            }
            if(valueAsObj instanceof BigInteger) {
                BigInteger value = (BigInteger) valueAsObj;
                setCellValueForDouble(cell, value.doubleValue());
                return;
            }
            if(valueAsObj instanceof Long) {
                Long value = (Long) valueAsObj;
                setCellValueForDouble(cell, (double)value);
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

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.