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.hpcloud.mon.app.command.CreateMetricCommand.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((dimensions == null) ? 0 : dimensions.hashCode());
    result = prime * result + ((name == null) ? 0 : name.hashCode());
    // Note Deep hash code is used here
    result = prime * result + Arrays.deepHashCode(timeValues);
    result = prime * result + (int) (timestamp ^ (timestamp >>> 32));
    long temp;//from w  w w  .j  av a  2s .c o m
    temp = Double.doubleToLongBits(value);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.opengamma.analytics.financial.model.option.definition.ForwardStartOptionDefinition.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = super.hashCode();
    result = prime * result + ((_moneyness == null) ? 0 : _moneyness.hashCode());
    long temp;/*from   w w  w. jav a 2 s .  c  om*/
    temp = Double.doubleToLongBits(_percent);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + ((_startTime == null) ? 0 : _startTime.hashCode());
    return result;
}

From source file:cn.remex.core.util.ObjectUtils.java

/**
 * Return the same value as <code>{@link Double#hashCode()}</code>.
 * @see Double#hashCode()// www . j av  a  2 s .c  o m
 */
public static int hashCode(final double dbl) {
    long bits = Double.doubleToLongBits(dbl);
    return hashCode(bits);
}

From source file:Encdec.java

public static int enc_doublebe(double d, byte[] dst, int di) {
    return enc_uint64be(Double.doubleToLongBits(d), dst, di);
}

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

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//from w w w.  j  a va 2 s  .  c o  m
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    DeliverableSwapFuturesSecurity other = (DeliverableSwapFuturesSecurity) obj;
    if (Double.doubleToLongBits(_deliveryTime) != Double.doubleToLongBits(other._deliveryTime)) {
        return false;
    }
    if (Double.doubleToLongBits(_lastTradingTime) != Double.doubleToLongBits(other._lastTradingTime)) {
        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.equity.option.EquityIndexFutureOptionDefinition.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + _exerciseType.hashCode();
    result = prime * result + _expiryDate.hashCode();
    result = prime * result + (_isCall ? 1231 : 1237);
    long temp;/* w ww .  j  av  a  2  s  . co m*/
    temp = Double.doubleToLongBits(_strike);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_pointValue);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_referencePrice);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + _underlying.hashCode();
    return result;
}

From source file:com.eTilbudsavis.etasdk.model.Pricing.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    Pricing other = (Pricing) obj;/*from w w  w  . j  av  a  2 s.c o  m*/
    if (mCurrency == null) {
        if (other.mCurrency != null)
            return false;
    } else if (!mCurrency.equals(other.mCurrency))
        return false;
    if (mPrePrice == null) {
        if (other.mPrePrice != null)
            return false;
    } else if (!mPrePrice.equals(other.mPrePrice))
        return false;
    if (Double.doubleToLongBits(mPrice) != Double.doubleToLongBits(other.mPrice))
        return false;
    return true;
}

From source file:com.opengamma.analytics.financial.model.option.definition.twoasset.EuropeanExchangeAssetOptionDefinition.java

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

From source file:Main.java

/** Equals for <tt>double</tt> fields. */
static public boolean areEqual(double aThis, double aThat) {

    return Double.doubleToLongBits(aThis) == Double.doubleToLongBits(aThat);
}

From source file:com.opengamma.analytics.financial.model.option.pricing.fourier.GaussianCharacteristicExponent.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from  www.ja va2 s  .  c om*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final GaussianCharacteristicExponent other = (GaussianCharacteristicExponent) obj;
    if (Double.doubleToLongBits(_mu) != Double.doubleToLongBits(other._mu)) {
        return false;
    }
    return Double.doubleToLongBits(_sigma) == Double.doubleToLongBits(other._sigma);
}