Examples of bigDecimalValue()


Examples of javax.json.JsonNumber.bigDecimalValue()

    public boolean equals(Object obj) {
        if (!(obj instanceof JsonNumber)) {
            return false;
        }
        JsonNumber other = (JsonNumber)obj;
        return bigDecimalValue().equals(other.bigDecimalValue());
    }

    @Override
    public String toString() {
        return bigDecimalValue().toString();
View Full Code Here

Examples of org.apache.commons.math3.fraction.BigFraction.bigDecimalValue()

        /*
         * BigFraction.doubleValue converts numerator to double and the
         * denominator to double and divides afterwards. That gives NaN quite
         * easy. This does not (scale is the number of digits):
         */
        return pFrac.bigDecimalValue(20, BigDecimal.ROUND_HALF_UP).doubleValue();
    }

    /**
     * Calculates {@code P(D_n < d)} using method described in [1] and doubles
     * (see above).
View Full Code Here

Examples of org.apache.commons.math3.fraction.BigFraction.bigDecimalValue()

        /*
         * BigFraction.doubleValue converts numerator to double and the denominator to double and
         * divides afterwards. That gives NaN quite easy. This does not (scale is the number of
         * digits):
         */
        return pFrac.bigDecimalValue(20, BigDecimal.ROUND_HALF_UP).doubleValue();
    }

    /**
     * Calculates {@code P(D_n < d)} using method described in [1] and doubles (see above).
     *
 
View Full Code Here

Examples of org.apache.commons.math3.fraction.BigFraction.bigDecimalValue()

        /*
         * BigFraction.doubleValue converts numerator to double and the
         * denominator to double and divides afterwards. That gives NaN quite
         * easy. This does not (scale is the number of digits):
         */
        return pFrac.bigDecimalValue(20, BigDecimal.ROUND_HALF_UP).doubleValue();
    }

    /**
     * Calculates {@code P(D_n < d)} using method described in [1] and doubles
     * (see above).
View Full Code Here

Examples of org.apache.commons.math3.fraction.BigFraction.bigDecimalValue()

        /*
         * BigFraction.doubleValue converts numerator to double and the denominator to double and
         * divides afterwards. That gives NaN quite easy. This does not (scale is the number of
         * digits):
         */
        return pFrac.bigDecimalValue(20, BigDecimal.ROUND_HALF_UP).doubleValue();
    }

    /**
     * Calculates {@code P(D_n < d)} using method described in [1] and doubles (see above).
     *
 
View Full Code Here

Examples of org.apache.commons.math3.fraction.BigFraction.bigDecimalValue()

        /*
         * BigFraction.doubleValue converts numerator to double and the
         * denominator to double and divides afterwards. That gives NaN quite
         * easy. This does not (scale is the number of digits):
         */
        return pFrac.bigDecimalValue(20, BigDecimal.ROUND_HALF_UP).doubleValue();
    }

    /**
     * Calculates {@code P(D_n < d)} using method described in [1] and doubles
     * (see above).
View Full Code Here

Examples of org.apache.commons.math3.fraction.BigFraction.bigDecimalValue()

        /*
         * BigFraction.doubleValue converts numerator to double and the
         * denominator to double and divides afterwards. That gives NaN quite
         * easy. This does not (scale is the number of digits):
         */
        return pFrac.bigDecimalValue(20, BigDecimal.ROUND_HALF_UP).doubleValue();
    }

    /**
     * Calculates {@code P(D_n < d)} using method described in [1] and doubles
     * (see above).
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveDecimal.bigDecimalValue()

    public void set(ValueOption<?> target, Object value) {
        if (value == null) {
            target.setNull();
        } else if (primitive) {
            HiveDecimal entity = inspector.getPrimitiveJavaObject(value);
            ((DecimalOption) target).modify(entity.bigDecimalValue());
        } else {
            HiveDecimalWritable writable = inspector.getPrimitiveWritableObject(value);
            ((DecimalOption) target).modify(writable.getHiveDecimal().bigDecimalValue());
        }
    }
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveDecimal.bigDecimalValue()

    return null;
  }

  private Object convertDecimalTypes(Object val, String javaColType) {
    HiveDecimal hd = (HiveDecimal) val;
    BigDecimal bd = hd.bigDecimalValue();

    if (javaColType.equals(BIG_DECIMAL_TYPE)) {
      return bd;
    } else if (javaColType.equals(STRING_TYPE)) {
      String bdStr = null;
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveDecimal.bigDecimalValue()

    assertEquals(0, ts.getTime() % 1000);
    for (int nanos : new int[] { 100000, 900000, 999100000, 999900000 }) {
      ts.setNanos(nanos);
      HiveDecimal d = timestampToDecimal(ts);
      assertEquals(ts, TimestampWritable.decimalToTimestamp(d));
      assertEquals(ts, TimestampWritable.doubleToTimestamp(d.bigDecimalValue().doubleValue()));
    }
  }

  public void testSerializationFormatDirectly() throws IOException {
    assertEquals("1970-01-01 00:00:00", fromIntAndVInts(0).toString());
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.