Package java.math

Examples of java.math.BigInteger.intValue()


        if (length != null) {
            BigInteger value = length.toIntegerValue();
            if (AttributeUtil.checkRange(
                    environment, length, label(ELEMENT_NAME),
                    value, 1L, (long) HiveChar.MAX_CHAR_LENGTH)) {
                trait.setCharTypeInfo(value.intValue());
            }
        }
        environment.reportAll(AttributeUtil.reportInvalidElements(attribute, elements.values()));
    }
View Full Code Here


        AstLiteral size = take(environment, attribute, elements, key, LiteralKind.INTEGER);
        if (size != null) {
            String label = label(key);
            BigInteger value = size.toIntegerValue();
            if (AttributeUtil.checkRange(environment, size, label, value, min, max)) {
                return value.intValue();
            }
        }
        return null;
    }
View Full Code Here

    public static S2LatLng decodeLocation(String locationString){
        String[] locationStringArray = locationString.split(",");
        BigInteger lat = new BigInteger(locationStringArray[0],16);
        BigInteger lng = new BigInteger(locationStringArray[1],16);
        double dlat = (double) lat.intValue() / 1000000;
        double dlng = (double) lng.intValue() / 1000000;
        S2LatLng ret = S2LatLng.fromDegrees(dlat, dlng);
        return ret;
    }
   
    public static String encodeLocation(S2LatLng s2ll){
View Full Code Here

  @Override
  Object getAsObject() {
    if (value instanceof BigInteger) {
      BigInteger big = (BigInteger) value;
      if (big.compareTo(INTEGER_MAX) < 0) {
        return big.intValue();
      } else if (big.compareTo(LONG_MAX) < 0) {
        return big.longValue();
      }
    }
    // No need to convert to float or double since those lose precision
View Full Code Here

      BigInteger bigInteger = (BigInteger) arg1;
      JSONObject jso = new JSONObject();
      if (ser.getMarshallClassHints()) {
        jso.put("javaClass", bigInteger.getClass().getName());
      }
      jso.put("value", bigInteger.intValue());
      return jso;
    } catch (Throwable t) {
      throw new MarshallException(t.getMessage());
    }
  }
View Full Code Here

     * @return DOCUMENT_ME
     */
    public int getMaxOccurs()
    {
        BigInteger maxOccurs = m_schemaProp.getMaxOccurs();
        return ( maxOccurs != null ) ? maxOccurs.intValue() : ( -1 );
    }

    /**
     * DOCUMENT_ME
     *
 
View Full Code Here

        BigInteger w = t.divide(BigInteger.valueOf(d2));
        if (w.bitLength() > 31) {
            throw new MathArithmeticException(LocalizedFormats.NUMERATOR_OVERFLOW_AFTER_MULTIPLY,
                                              w);
        }
        return new Fraction (w.intValue(),
                ArithmeticUtils.mulAndCheck(denominator/d1,
                        fraction.denominator/d2));
    }

    /**
 
View Full Code Here

    else {
      BigInteger[] Bs=BigMath.bigint2exps(B);
      BigInteger R=BigMath.zero;
      for(int i=0;i<Bs.length;i++) {
        BigInteger E=heval(NVARS,Bs[i]);
        R=R.setBit(E.intValue());
      }
      return R;
    }
  }
 
View Full Code Here

            this.eon = null;
            this.year = DatatypeConstants.FIELD_UNDEFINED;
        }
        else {
            BigInteger temp = year.remainder(BILLION_B);
            this.year = temp.intValue();
            setEon(year.subtract(temp));
        }
    }

    /**
 
View Full Code Here

            this.eon = null;
        }
        else {
            BigInteger theYear = BigInteger.valueOf((long) year);
            BigInteger remainder = theYear.remainder(BILLION_B);
            this.year = remainder.intValue();
            setEon(theYear.subtract(remainder));
        }
    }

    /**
 
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.