@Override public Value add(Value v) { ValueDouble v2 = (ValueDouble) v; return ValueDouble.get(value + v2.value); }
@Override public Value divide(Value v) { ValueDouble v2 = (ValueDouble) v; if (v2.value == 0.0) { throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); } return ValueDouble.get(value / v2.value); }
@Override public Value multiply(Value v) { ValueDouble v2 = (ValueDouble) v; return ValueDouble.get(value * v2.value); }
@Override public ValueDouble modulus(Value v) { ValueDouble other = (ValueDouble) v; if (other.value == 0) { throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); } return ValueDouble.get(value % other.value); }
@Override public Value negate() { return ValueDouble.get(-value); }
@Override public Value subtract(Value v) { ValueDouble v2 = (ValueDouble) v; return ValueDouble.get(value - v2.value); }
return ValueNull.INSTANCE; v = ValueDouble.get(Math.sqrt(m2 / count)); break; return ValueNull.INSTANCE; v = ValueDouble.get(Math.sqrt(m2 / (count - 1))); break; return ValueNull.INSTANCE; v = ValueDouble.get(m2 / count); break; return ValueNull.INSTANCE; v = ValueDouble.get(m2 / (count - 1)); break;
/** * Sets the value of a parameter. * * @param parameterIndex the parameter index (1, 2, ...) * @param x the value * @throws SQLException if this object is closed */ @Override public void setDouble(int parameterIndex, double x) throws SQLException { try { if (isDebugEnabled()) { debugCode("setDouble(" + parameterIndex + ", " + x + "d);"); } setParameter(parameterIndex, ValueDouble.get(x)); } catch (Exception e) { throw logAndConvert(e); } }
/** * Updates a column in the current or insert row. * * @param columnIndex (1,2,...) * @param x the value * @throws SQLException if the result set is closed or not updatable */ @Override public void updateDouble(int columnIndex, double x) throws SQLException { try { if (isDebugEnabled()) { debugCode("updateDouble(" + columnIndex + ", " + x + "d);"); } update(columnIndex, ValueDouble.get(x)); } catch (Exception e) { throw logAndConvert(e); } }
/** * Updates a column in the current or insert row. * * @param columnLabel the column label * @param x the value * @throws SQLException if the result set is closed or not updatable */ @Override public void updateDouble(String columnLabel, double x) throws SQLException { try { if (isDebugEnabled()) { debugCode("updateDouble(" + quote(columnLabel) + ", " + x + "d);"); } update(columnLabel, ValueDouble.get(x)); } catch (Exception e) { throw logAndConvert(e); } }
double value = rs.getDouble(columnIndex); v = rs.wasNull() ? (Value) ValueNull.INSTANCE : ValueDouble.get(value); break;
return ValueFloat.get(((Float) x).floatValue()); } else if (x instanceof Double) { return ValueDouble.get(((Double) x).doubleValue()); } else if (x instanceof byte[]) { return ValueBytes.get((byte[]) x);
break; case ACOS: result = ValueDouble.get(Math.acos(v0.getDouble())); break; case ASIN: result = ValueDouble.get(Math.asin(v0.getDouble())); break; case ATAN: result = ValueDouble.get(Math.atan(v0.getDouble())); break; case CEILING: result = ValueDouble.get(Math.ceil(v0.getDouble())); break; case COS: result = ValueDouble.get(Math.cos(v0.getDouble())); break; case COSH: result = ValueDouble.get(Math.cosh(v0.getDouble())); break; case COT: { result = ValueDouble.get(1. / d); break; result = ValueDouble.get(Math.toDegrees(v0.getDouble())); break; case EXP: result = ValueDouble.get(Math.exp(v0.getDouble())); break;
switch (getType()) { case BOOLEAN: return ValueDouble.get(getBoolean().booleanValue() ? 1 : 0); case BYTE: return ValueDouble.get(getByte()); case SHORT: return ValueDouble.get(getShort()); case INT: return ValueDouble.get(getInt()); case LONG: return ValueDouble.get(getLong()); case DECIMAL: return ValueDouble.get(getBigDecimal().doubleValue()); case FLOAT: return ValueDouble.get(getFloat()); return ValueStringFixed.get(s); case DOUBLE: return ValueDouble.get(Double.parseDouble(s.trim())); case FLOAT: return ValueFloat.get(Float.parseFloat(s.trim()));
switch (info.type) { case ATAN2: result = ValueDouble.get( Math.atan2(v0.getDouble(), v1.getDouble())); break; result = ValueDouble.get(Math.pow( v0.getDouble(), v1.getDouble())); break; case ROUND: { double f = v1 == null ? 1. : Math.pow(10., v1.getDouble()); result = ValueDouble.get(Math.round(v0.getDouble() * f) / f); break; double f = Math.pow(10., p); double g = d * f; result = ValueDouble.get(((d < 0) ? Math.ceil(g) : Math.floor(g)) / f);