Package java.math

Examples of java.math.BigInteger.byteValue()


      for (Map.Entry<BigInteger, Integer> entry : numbers.entrySet()) {
        BigInteger number = entry.getKey();
        Integer size = entry.getValue();
       
        if (size == Byte.SIZE) {
          assertEquals(number.byteValue(), dis.readByte());
        } else if (size == Short.SIZE) {
          assertEquals(number.shortValue(), dis.readShort());
        } else if (size == Integer.SIZE) {
          assertEquals(number.intValue(), dis.readInt());
        } else if (size == Long.SIZE) {
View Full Code Here


                    if ( gt > 0 || lt < 0 )
                    {
                        throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"byte",s}),
                                                PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
                    }
                    return i.byteValue();
                }
                catch ( NumberFormatException ex )
                {
                    throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"byte",s}),
                                            PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
View Full Code Here

        return values.get(index);
      case SUM:
        BigInteger sum = BigInteger.valueOf(0);
        for (int i = 0; i < values.size(); ++i)
          sum = sum.add(BigInteger.valueOf(values.get(i)));
        return sum.byteValue();
      case MIN:
        BigInteger minimum = BigInteger.valueOf(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (minimum.compareTo(BigInteger.valueOf(
              values.get(i))) > 0)
View Full Code Here

        BigInteger minimum = BigInteger.valueOf(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (minimum.compareTo(BigInteger.valueOf(
              values.get(i))) > 0)
            minimum = BigInteger.valueOf(values.get(i));
        return minimum.byteValue();
      case MAX:
        BigInteger maximum = BigInteger.valueOf(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (maximum.compareTo(BigInteger.valueOf(
              values.get(i))) < 0)
View Full Code Here

        BigInteger maximum = BigInteger.valueOf(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (maximum.compareTo(BigInteger.valueOf(
              values.get(i))) < 0)
            maximum = BigInteger.valueOf(values.get(i));
        return maximum.byteValue();
      case FIRST:
        return values.get(0);
      case LAST:
        return values.get(values.size() - 1);
      default:
View Full Code Here

                    if ( gt > 0 || lt < 0 )
                    {
                        throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"byte",s}),
                                                PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
                    }
                    return i.byteValue();
                }
                catch ( NumberFormatException ex )
                {
                    throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"byte",s}),
                                            PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
View Full Code Here

                    if ( gt > 0 || lt < 0 )
                    {
                        throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"byte",s}),
                                                PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
                    }
                    return i.byteValue();
                }
                catch ( NumberFormatException ex )
                {
                    throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"byte",s}),
                                            PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
View Full Code Here

                    if (k.compareTo(_32_) < 0) {
                        DataWord word2 = program.stackPop();
                        if (logger.isInfoEnabled())
                            hint = word1 + "  " + word2.value();
                        word2.signExtend(k.byteValue());
                        program.stackPush(word2);
                    }
                    program.step();
                }   break;
                case NOT:{
View Full Code Here

        BigInteger andValue = new BigInteger("ff", 16);

        for (int i = 0, index = 15; i < 16; i++, index--) {
            BigInteger shift = bigInt.shiftRight(i * 8);
            shift = shift.and(andValue);
            array[index] = shift.byteValue();
        }

        return array;
    }

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.