public long setDoubleValue(long flags, double value) { if (Double.isNaN(value)) throw new IllegalArgumentException("Value cannot be NaN"); // scale value long tmpValue = Math.round(value / factor); checkValue((long) (tmpValue * factor)); tmpValue <<= shift; // clear value bits flags &= ~mask; // set value return flags | tmpValue; }
public long setDoubleValue(long flags, double value) { if (Double.isNaN(value)) throw new IllegalArgumentException("Value cannot be NaN"); // scale value long tmpValue = Math.round(value / factor); checkValue((long) (tmpValue * factor)); tmpValue <<= shift; // clear value bits flags &= ~mask; // set value return flags | tmpValue; }
public long setDoubleValue(long flags, double value) { if (Double.isNaN(value)) throw new IllegalArgumentException("Value cannot be NaN"); // scale value long tmpValue = Math.round(value / factor); checkValue((long) (tmpValue * factor)); tmpValue <<= shift; // clear value bits flags &= ~mask; // set value return flags | tmpValue; }
public long setDoubleValue( long flags, double value ) { if (Double.isNaN(value)) throw new IllegalStateException("Value cannot be NaN"); // scale value long tmpValue = Math.round(value / factor); checkValue(Math.round(tmpValue * factor)); tmpValue <<= shift; // clear value bits flags &= ~mask; // set value return flags | tmpValue; }