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.commodity.definition.CommodityFutureOptionDefinition.java

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

From source file:io.seldon.client.beans.UserTrustNodeBean.java

@Override
public int hashCode() {
    int result;//from  www .ja  v  a 2  s . c o m
    long temp;
    result = user != null ? user.hashCode() : 0;
    temp = trust != +0.0d ? Double.doubleToLongBits(trust) : 0L;
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    result = 31 * result + (int) (pos ^ (pos >>> 32));
    result = 31 * result + (dimension != null ? dimension.hashCode() : 0);
    return result;
}

From source file:org.numenta.nupic.algorithms.Statistic.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    Statistic other = (Statistic) obj;//  w  w  w.j av a 2 s .co  m
    if (Double.doubleToLongBits(mean) != Double.doubleToLongBits(other.mean))
        return false;
    if (Double.doubleToLongBits(stdev) != Double.doubleToLongBits(other.stdev))
        return false;
    if (Double.doubleToLongBits(variance) != Double.doubleToLongBits(other.variance))
        return false;
    return true;
}

From source file:com.opengamma.maths.lowlevelapi.datatypes.primitive.MatrixPrimitiveUtils.java

/**
 * Counts number of *true* nonzero elements in a vector
 * @param aVector which is the vector (array of doubles) being tested
 * @return tmp the number of nonzero elements in the vector
 *//*from   ww  w .  jav a  2  s  .c  o m*/
public static int numberOfNonZeroElementsInVector(int[] aVector) {
    int tmp = 0;
    for (int i = 0; i < aVector.length; i++) {
        if (Double.doubleToLongBits(aVector[i]) != 0L) {
            tmp++;
        }
    }
    return tmp;
}

From source file:org.jberet.support.io.Cape.java

@Override
public int hashCode() {
    int result;/*  w  ww. j av a 2 s  . c  o m*/
    long temp;
    temp = Double.doubleToLongBits(date);
    result = (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(sp);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(dividend);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(earnings);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(cpi);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(dateFraction);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(longInterestRate);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(realPrice);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(realDividend);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(realEarnings);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    result = 31 * result + (cape != null ? cape.hashCode() : 0);
    return result;
}

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

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from   w w w .jav  a2s  . co m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final BondFuturesTransaction other = (BondFuturesTransaction) obj;
    if (_quantity != other._quantity) {
        return false;
    }
    if (Double.doubleToLongBits(_referencePrice) != Double.doubleToLongBits(other._referencePrice)) {
        return false;
    }
    if (!ObjectUtils.equals(_underlyingFuture, other._underlyingFuture)) {
        return false;
    }
    return true;
}

From source file:jsat.distributions.SingleValueDistribution.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    long temp;//ww w .ja  va 2  s.  c o  m
    temp = Double.doubleToLongBits(value);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.opengamma.analytics.math.statistics.distribution.ChiSquareDistribution.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    long temp;/* w  w w .j  av a2  s.com*/
    temp = Double.doubleToLongBits(_degrees);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

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

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//w w  w .j  a  v a  2  s .  c  o  m
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final FadeInOptionDefinition other = (FadeInOptionDefinition) obj;
    if (Double.doubleToLongBits(_lowerBound) != Double.doubleToLongBits(other._lowerBound)) {
        return false;
    }
    if (Double.doubleToLongBits(_upperBound) != Double.doubleToLongBits(other._upperBound)) {
        return false;
    }
    return true;
}

From source file:com.cloudmine.api.CMGeoPoint.java

@Override
public int hashCode() {
    int result;/*  w  w  w  .ja v a  2s  .  c  o m*/
    long temp;
    temp = latitude != +0.0d ? Double.doubleToLongBits(latitude) : 0L;
    result = (int) (temp ^ (temp >>> 32));
    temp = longitude != +0.0d ? Double.doubleToLongBits(longitude) : 0L;
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    return result;
}