@Override public Value divide(Value v) { return ValueTime.fromNanos((long) (nanos / v.getDouble())); }
@Override public Value multiply(Value v) { return ValueTime.fromNanos((long) (nanos * v.getDouble())); }
public double getDouble() { return convertTo(Value.DOUBLE).getDouble(); }
/** * Returns the value of the specified column as a double. * * @param columnIndex (1,2,...) * @return the value * @throws SQLException if the column is not found or if the result set is * closed */ @Override public double getDouble(int columnIndex) throws SQLException { try { debugCodeCall("getDouble", columnIndex); return get(columnIndex).getDouble(); } catch (Exception e) { throw logAndConvert(e); } }
/** * Returns the value of the specified column as a double. * * @param columnLabel the column label * @return the value * @throws SQLException if the column is not found or if the result set is * closed */ @Override public double getDouble(String columnLabel) throws SQLException { try { debugCodeCall("getDouble", columnLabel); return get(columnLabel).getDouble(); } catch (Exception e) { throw logAndConvert(e); } }
double x = v.getDouble(); if (count == 1) { mean = 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: { double d = Math.tan(v0.getDouble()); if (d == 0.0) { throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); result = ValueDouble.get(Math.toDegrees(v0.getDouble())); break; case EXP: result = ValueDouble.get(Math.exp(v0.getDouble())); break;
return ValueByte.get(convertToByte(convertToLong(getBigDecimal()))); case DOUBLE: return ValueByte.get(convertToByte(convertToLong(getDouble()))); case FLOAT: return ValueByte.get(convertToByte(convertToLong(getFloat()))); return ValueShort.get(convertToShort(convertToLong(getBigDecimal()))); case DOUBLE: return ValueShort.get(convertToShort(convertToLong(getDouble()))); case FLOAT: return ValueShort.get(convertToShort(convertToLong(getFloat()))); return ValueInt.get(convertToInt(convertToLong(getBigDecimal()))); case DOUBLE: return ValueInt.get(convertToInt(convertToLong(getDouble()))); case FLOAT: return ValueInt.get(convertToInt(convertToLong(getFloat()))); return ValueLong.get(convertToLong(getBigDecimal())); case DOUBLE: return ValueLong.get(convertToLong(getDouble())); case FLOAT: return ValueLong.get(convertToLong(getFloat())); return ValueDecimal.get(BigDecimal.valueOf(getLong())); case DOUBLE: { double d = getDouble(); if (Double.isInfinite(d) || Double.isNaN(d)) { throw DbException.get(
case ATAN2: result = ValueDouble.get( Math.atan2(v0.getDouble(), v1.getDouble())); break; case BITAND: 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; result = ValueTimestamp.fromMillis(c.getTimeInMillis()); } else { double d = v0.getDouble(); int p = v1 == null ? 0 : v1.getInt(); double f = Math.pow(10., p);