Example usage for java.lang Double doubleToLongBits

List of usage examples for java.lang Double doubleToLongBits

Introduction

In this page you can find the example usage for java.lang Double doubleToLongBits.

Prototype

@HotSpotIntrinsicCandidate
public static long doubleToLongBits(double value) 

Source Link

Document

Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout.

Usage

From source file:com.opengamma.analytics.financial.interestrate.future.derivative.BondFuturesSecurity.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//from  w w w .j ava2 s . c  om
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    BondFuturesSecurity other = (BondFuturesSecurity) obj;
    if (!Arrays.equals(_conversionFactor, other._conversionFactor)) {
        return false;
    }
    if (!Arrays.equals(_deliveryBasket, other._deliveryBasket)) {
        return false;
    }
    if (Double.doubleToLongBits(_deliveryFirstTime) != Double.doubleToLongBits(other._deliveryFirstTime)) {
        return false;
    }
    if (Double.doubleToLongBits(_deliveryLastTime) != Double.doubleToLongBits(other._deliveryLastTime)) {
        return false;
    }
    if (Double.doubleToLongBits(_noticeFirstTime) != Double.doubleToLongBits(other._noticeFirstTime)) {
        return false;
    }
    if (Double.doubleToLongBits(_noticeLastTime) != Double.doubleToLongBits(other._noticeLastTime)) {
        return false;
    }
    if (Double.doubleToLongBits(_notional) != Double.doubleToLongBits(other._notional)) {
        return false;
    }
    if (Double.doubleToLongBits(_tradingLastTime) != Double.doubleToLongBits(other._tradingLastTime)) {
        return false;
    }
    return true;
}

From source file:cc.redberry.core.number.Numeric.java

/**
 * @return similar to {@link Double}/* w  w  w. j  a va2s  .c o  m*/
 * @see Double#hashCode()
 */
@Override
public int hashCode() {
    long bits = Double.doubleToLongBits(value * value);
    return (int) (bits ^ (bits >>> 32));
}

From source file:com.opengamma.analytics.financial.instrument.future.DeliverableSwapFuturesSecurityDefinition.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/* ww w. j av a2 s.c o  m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final DeliverableSwapFuturesSecurityDefinition other = (DeliverableSwapFuturesSecurityDefinition) obj;
    if (!ObjectUtils.equals(_deliveryDate, other._deliveryDate)) {
        return false;
    }
    if (!ObjectUtils.equals(_lastTradingDate, other._lastTradingDate)) {
        return false;
    }
    if (Double.doubleToLongBits(_notional) != Double.doubleToLongBits(other._notional)) {
        return false;
    }
    if (!ObjectUtils.equals(_underlyingSwap, other._underlyingSwap)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.instrument.future.InterestRateFutureOptionPremiumTransactionDefinition.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from w ww  .j  a v  a  2 s  .c  om
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final InterestRateFutureOptionPremiumTransactionDefinition other = (InterestRateFutureOptionPremiumTransactionDefinition) obj;
    if (!ObjectUtils.equals(_premium, other._premium)) {
        return false;
    }
    if (_quantity != other._quantity) {
        return false;
    }
    if (Double.doubleToLongBits(_tradePrice) != Double.doubleToLongBits(other._tradePrice)) {
        return false;
    }
    if (!ObjectUtils.equals(_underlyingOption, other._underlyingOption)) {
        return false;
    }
    return true;
}

From source file:etymology.util.EtyMath.java

public static double approxLn(double val) {
    final double x = (Double.doubleToLongBits(val) >> 32);
    return (x - 1072632447) / 1512775;
}

From source file:com.opengamma.analytics.financial.interestrate.bond.definition.BondFixedSecurity.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*ww  w  . jav a2s.c o m*/
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final BondFixedSecurity other = (BondFixedSecurity) obj;
    if (Double.doubleToLongBits(_accruedInterest) != Double.doubleToLongBits(other._accruedInterest)) {
        return false;
    }
    if (_couponPerYear != other._couponPerYear) {
        return false;
    }
    if (Double.doubleToLongBits(_factorToNextCoupon) != Double.doubleToLongBits(other._factorToNextCoupon)) {
        return false;
    }
    if (!ObjectUtils.equals(_yieldConvention, other._yieldConvention)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.interestrate.payments.derivative.CapFloorCMS.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = super.hashCode();
    result = prime * result + (_isCap ? 1231 : 1237);
    long temp;/*ww  w.  j a  v  a2  s  .  c  o m*/
    temp = Double.doubleToLongBits(_settlementTime);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_strike);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + _underlyingSwap.hashCode();
    return result;
}

From source file:com.opengamma.analytics.financial.covariance.HistoricalVolatilityCalculator.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((_mode == null) ? 0 : _mode.hashCode());
    long temp;// w  w w  .  j a v  a 2  s.co m
    temp = Double.doubleToLongBits(_percentBadDataPoints);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.opengamma.analytics.financial.interestrate.payments.derivative.CouponONSpread.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*  www  .ja  va  2  s.  c o  m*/
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final CouponONSpread other = (CouponONSpread) obj;
    if (Double.doubleToLongBits(_fixingPeriodAccrualFactor) != Double
            .doubleToLongBits(other._fixingPeriodAccrualFactor)) {
        return false;
    }
    if (Double.doubleToLongBits(_fixingPeriodEndTime) != Double.doubleToLongBits(other._fixingPeriodEndTime)) {
        return false;
    }
    if (Double.doubleToLongBits(_fixingPeriodStartTime) != Double
            .doubleToLongBits(other._fixingPeriodStartTime)) {
        return false;
    }
    if (!ObjectUtils.equals(_index, other._index)) {
        return false;
    }
    if (Double.doubleToLongBits(_notionalAccrued) != Double.doubleToLongBits(other._notionalAccrued)) {
        return false;
    }
    if (Double.doubleToLongBits(_spreadAmount) != Double.doubleToLongBits(other._spreadAmount)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.model.option.pricing.tree.DoubleBarrierOptionFunctionProvider.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//from  w  ww. j ava  2  s.c  o m
    if (!super.equals(obj)) {
        return false;
    }
    if (!(obj instanceof DoubleBarrierOptionFunctionProvider)) {
        return false;
    }
    DoubleBarrierOptionFunctionProvider other = (DoubleBarrierOptionFunctionProvider) obj;
    if (Double.doubleToLongBits(_upperBarrier) != Double.doubleToLongBits(other._upperBarrier)) {
        return false;
    }
    return true;
}