@Nonnull private static BigDecimal _getParam (@Nonnull final AbstractJSAtomNumeric aRhs) { return aRhs instanceof JSAtomBigDecimal ? ((JSAtomBigDecimal) aRhs).getContainedValue () : BigDecimal.valueOf (aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericDiv (@Nonnull final AbstractJSAtomNumeric aRhs) { return new JSAtomDecimal (m_dValue / aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericMod (@Nonnull final AbstractJSAtomNumeric aRhs) { return new JSAtomDecimal (m_dValue % aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericPlus (@Nonnull final AbstractJSAtomNumeric aRhs) { return new JSAtomDecimal (m_dValue + aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericMod (@Nonnull final AbstractJSAtomNumeric aRhs) { return new JSAtomDecimal (m_dValue % aRhs.doubleValue ()); }
@Nonnull private static BigDecimal _getParam (@Nonnull final AbstractJSAtomNumeric aRhs) { return aRhs instanceof JSAtomBigDecimal ? ((JSAtomBigDecimal) aRhs).getContainedValue () : BigDecimal.valueOf (aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericMinus (@Nonnull final AbstractJSAtomNumeric aRhs) { return new JSAtomDecimal (m_dValue - aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericMul (@Nonnull final AbstractJSAtomNumeric aRhs) { return new JSAtomDecimal (m_dValue * aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericMinus (@Nonnull final AbstractJSAtomNumeric aRhs) { return new JSAtomDecimal (m_dValue - aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericDiv (@Nonnull final AbstractJSAtomNumeric aRhs) { // In JS there is by default no integer division: 5/2===2.5 return new JSAtomDecimal (m_nValue / aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericPlus (@Nonnull final AbstractJSAtomNumeric aRhs) { return new JSAtomDecimal (m_dValue + aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericDiv (@Nonnull final AbstractJSAtomNumeric aRhs) { return new JSAtomDecimal (m_dValue / aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericDiv (@Nonnull final AbstractJSAtomNumeric aRhs) { // In JS there is by default no integer division: 5/2===2.5 return new JSAtomDecimal (m_nValue / aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericMod (@Nonnull final AbstractJSAtomNumeric aRhs) { if (aRhs.isDecimalValue ()) return new JSAtomDecimal (m_nValue % aRhs.doubleValue ()); return new JSAtomInt (m_nValue % (long) aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericPlus (@Nonnull final AbstractJSAtomNumeric aRhs) { if (aRhs.isDecimalValue ()) return new JSAtomDecimal (m_nValue + aRhs.doubleValue ()); return new JSAtomInt (m_nValue + (long) aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericMinus (@Nonnull final AbstractJSAtomNumeric aRhs) { if (aRhs.isDecimalValue ()) return new JSAtomDecimal (m_nValue - aRhs.doubleValue ()); return new JSAtomInt (m_nValue - (long) aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericMul (@Nonnull final AbstractJSAtomNumeric aRhs) { if (aRhs.isDecimalValue ()) return new JSAtomDecimal (m_nValue * aRhs.doubleValue ()); return new JSAtomInt (m_nValue * (long) aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericMul (@Nonnull final AbstractJSAtomNumeric aRhs) { if (aRhs.isDecimalValue ()) return new JSAtomDecimal (m_nValue * aRhs.doubleValue ()); return new JSAtomInt (m_nValue * (long) aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericPlus (@Nonnull final AbstractJSAtomNumeric aRhs) { if (aRhs.isDecimalValue ()) return new JSAtomDecimal (m_nValue + aRhs.doubleValue ()); return new JSAtomInt (m_nValue + (long) aRhs.doubleValue ()); }
@Override @Nonnull public AbstractJSAtomNumeric numericMod (@Nonnull final AbstractJSAtomNumeric aRhs) { if (aRhs.isDecimalValue ()) return new JSAtomDecimal (m_nValue % aRhs.doubleValue ()); return new JSAtomInt (m_nValue % (long) aRhs.doubleValue ()); }