Process a single double value.

If the new value is smaller than the current minimum, it will become the
new minimum.

If the new value is larger than the current maximum, it will become the new
maximum.

@param val New value
185881
public void put(double val) {
    min = val < min ? val : min;
    max = val > max ? val : max;
  }
742062
public void put(NumberVector val) {
    assert (val.getDimensionality() == elements.length);
    wsum += 1.0;
    for(int i = 0; i < elements.length; i++) {
      final double delta = val.doubleValue(i) - elements[i];
      elements[i] += delta / wsum;
    }
  }
618871
public void put(Double value) {
		if (value == null) {
			this.compiledStatement.bindNull(compiledStatementBindIndex++);
		} else {
			this.compiledStatement.bindDouble(compiledStatementBindIndex++, value);
		}
	}
1306061
@Override
  public void put(double val, double weight) {
    if(weight <= 0) {
      return;
    }
    if(this.n == 0) {
      n = weight;
      min = max = val;
      sum = val * weight;
      m2 = m3 = m4 = 0;
      return;
    }
    final double nn = weight + this.n;
    final double deltan = val * this.n - this.sum;
    final double inc = deltan * weight;

    // Some factors used below:
    final double delta_nn = deltan / (this.n * nn);
    final double delta_nnw = delta_nn * weight;
    final double delta_nn2 = delta_nn * delta_nn;
    final double delta_nn3 = delta_nn2 * delta_nn;
    final double nb2 = weight * weight;

    final double tmp1 = this.n - weight;
    final double tmp2 = this.n * tmp1 + nb2;
    this.m4 += inc * delta_nn3 * tmp2 + 6. * nb2 * this.m2 * delta_nn2 - 4. * this.m3 * delta_nnw;
    this.m3 += inc * delta_nn2 * tmp1 - 3. * this.m2 * delta_nnw;
    this.m2 += inc * delta_nn;
    this.sum += weight * val;
    this.n = nn;

    min = val < min ? val : min;
    max = val > max ? val : max;
  }
1098951
ProgressEvent updateProgress(double val, long now) {
		if (val<0 || val>1) {
			throw new IllegalArgumentException("Value out of range [0, 1]: " + val);
		}
		if (val<=progress.getProgress()) {
			reset(start);
		}
		double pD = val - progress.getProgress();
		long tD = now - tstamp;
		if (step > 0) {
			step = step * 0.3 + (tD / pD) * 0.7; 
		} else {
			step = (tD / pD);
		}
		double etcMs = step * (1 - val);
		progress = new ProgressEvent(val, new Date(now + (long)Math.round(etcMs)));
		tstamp = now;
		return progress;
	}
391733
public void addNextValue(Object val) {
    String newVal = val.toString();
    if (this.maxVal == null || this.maxVal.compareTo(newVal) < 0) {
      this.maxVal = newVal;
    }
  }
1045605
public void setDouble(Double value) {
		this.checkNull(value);
		list.add(value);
		type.add(Double.class);
	}
964724
public Rational multiply(final BigInteger val) {
        Rational val2 = new Rational(val, BigInteger.ONE);
        return (multiply(val2));
    }
556904
protected double toDouble(final Object val) {

        if (val == null) {
            return Double.NaN;
        } else if (Double.class.isInstance(val)) {
            return Double.class.cast(val);
        } else if (Number.class.isInstance(val)) {
            return Number.class.cast(val).doubleValue();
        } else if (double.class.isInstance(val)) {
            return double.class.cast(val);
        } else if (long.class.isInstance(val)) {
            return long.class.cast(val);
        } else if (int.class.isInstance(val)) {
            return int.class.cast(val);
        } else if (byte.class.isInstance(val)) {
            return byte.class.cast(val);
        } else if (float.class.isInstance(val)) {
            return float.class.cast(val);
        } else {
            return Double.NaN;
        }
    }
266915
@Override
  public void put(double val, double weight) {
    if(weight == 0.) {
      return;
    }
    if(n <= 0) {
      n = weight;
      sum = val * weight;
      return;
    }
    val *= weight;
    final double tmp = n * val - sum * weight;
    final double oldn = n; // tmp copy
    n += weight;
    sum += val;
    m2 += tmp * tmp / (weight * n * oldn);
  }
92904
@CheckReturnValue
  public UnsignedInteger minus(UnsignedInteger val) {
    return fromIntBits(value - checkNotNull(val).value);
  }
316244
public void multiplyValue(int idx, double val) {
        values[idx] = s.times(values[idx], val); 
    }
1006985
public void setValue(final double VALUE) {
        oldValue = value;

        value = VALUE < niceMinValue ? niceMinValue : (VALUE > niceMaxValue ? niceMaxValue : VALUE);

        fireStateChanged();
    }
156344
public static BigDecimal bigDecimalValue(BigDecimal val)
    {
        if (val == null
            || val.getClass() == BigDecimal.class)
        {
            return val;
        }
        return new BigDecimal(val.unscaledValue(), val.scale());
    }
204589
public void put(double[] val) {
    assert (val.length == elements.length);
    wsum += 1.0;
    for(int i = 0; i < elements.length; i++) {
      final double delta = val[i] - elements[i];
      elements[i] += delta / wsum;
    }
  }
1084519
public void increment(double val) {
        if (!enabled)
            return;

        lastSampleTime = System.currentTimeMillis();
        if (!sync) {
            count += val;
        } else {
            synchronized (this) {
                count += val;
            }
        }
    }
304473
public static long safeMultiply(long val1, int val2) {
        switch (val2) {
            case -1:
                if (val1 == Long.MIN_VALUE) {
                    throw new ArithmeticException("Multiplication overflows a long: " + val1 + " * " + val2);
                }
                return -val1;
            case 0:
                return 0L;
            case 1:
                return val1;
        }
        long total = val1 * val2;
        if (total / val2 != val1) {
          throw new ArithmeticException("Multiplication overflows a long: " + val1 + " * " + val2);
        }
        return total;
    }