Example usage for java.lang Float isNaN

List of usage examples for java.lang Float isNaN

Introduction

In this page you can find the example usage for java.lang Float isNaN.

Prototype

public static boolean isNaN(float v) 

Source Link

Document

Returns true if the specified number is a Not-a-Number (NaN) value, false otherwise.

Usage

From source file:juicebox.matrix.SymmetricMatrix.java

@Override
public float getLowerValue() {
    if (Float.isNaN(lowerValue)) {
        computePercentiles();
    }
    return lowerValue;
}

From source file:com.frank.search.solr.core.mapping.SimpleSolrPersistentEntity.java

private Float derivateDocumentBoost() {

    SolrDocument solrDocument = findAnnotation(SolrDocument.class);
    if (solrDocument != null && !Float.isNaN(solrDocument.boost())) {
        return solrDocument.boost();
    }/*from   ww w .j  a va2 s.co  m*/
    return null;
}

From source file:IEEE754rUtils.java

/**
 * <p>Gets the minimum of two <code>float</code> values.</p>
 * //from  w  ww .j a v  a2s .  c o  m
 * <p>NaN is only returned if all numbers are NaN as per IEEE-754r. </p>
 *
 * @param a  value 1
 * @param b  value 2
 * @return  the smallest of the values
 */
public static float min(float a, float b) {
    if (Float.isNaN(a)) {
        return b;
    } else if (Float.isNaN(b)) {
        return a;
    } else {
        return Math.min(a, b);
    }
}

From source file:juicebox.matrix.SymmetricMatrix.java

@Override
public float getUpperValue() {
    if (Float.isNaN(upperValue)) {
        computePercentiles();
    }
    return upperValue;
}

From source file:com.facebook.react.views.toolbar.ReactToolbarManager.java

@ReactProp(name = "contentInsetStart", defaultFloat = Float.NaN)
public void setContentInsetStart(ReactToolbar view, float insetStart) {
    int inset = Float.isNaN(insetStart) ? getDefaultContentInsets(view.getContext())[0]
            : Math.round(PixelUtil.toPixelFromDIP(insetStart));
    view.setContentInsetsRelative(inset, view.getContentInsetEnd());
}

From source file:eu.itesla_project.modelica_export.records.CapacitorRecord.java

@Override
public void createRecord(ModExportContext modContext, DDBManager ddbManager, SimulatorInst simulator) {
    //      if(this.busInfo.isConnected()) {
    if (!Float.isNaN(this.busInfo.getBus().getV()) && this.busInfo.isConnected()) {
        if (super.isCorrect()) {
            if (!this.busInfo.isConnected())
                this.addValue(StaticData.COMMENT);

            if (super.getModelicaType() != null)
                this.addValue(super.getModelicaType() + StaticData.WHITE_SPACE);
            else//from   ww w  .j  a  v  a  2  s. c om
                this.addValue(DEFAULT_CAPACITOR_TYPE + StaticData.WHITE_SPACE);
            this.addValue(super.getModelicaName());
            this.addValue(" (");
            this.addValue(StaticData.NEW_LINE);

            if (!iidmcapacitorParameters.isEmpty()) {
                for (int i = 0; i < iidmcapacitorParameters.size() - 1; i++) {
                    if (!this.busInfo.isConnected())
                        this.addValue(StaticData.COMMENT);
                    this.addValue("\t " + iidmcapacitorParameters.get(i).getName() + " = "
                            + iidmcapacitorParameters.get(i).getValue() + ",");
                    this.addValue(StaticData.NEW_LINE);
                }
                if (!this.busInfo.isConnected())
                    this.addValue(StaticData.COMMENT);
                this.addValue("\t " + iidmcapacitorParameters.get(iidmcapacitorParameters.size() - 1).getName()
                        + " = " + iidmcapacitorParameters.get(iidmcapacitorParameters.size() - 1).getValue());
                this.addValue(StaticData.NEW_LINE);
            }
            if (!this.busInfo.isConnected())
                this.addValue(StaticData.COMMENT);
            this.addValue("\t " + EurostagFixedData.ANNOT);

            //Clear data
            iidmcapacitorParameters = null;
        } else
            _log.error(this.getModelicaName() + " not added to grid model.");
    } else {
        _log.warn("Capacitor " + this.getModelicaName() + " disconnected.");
        this.addValue(StaticData.COMMENT + " Capacitor " + this.getModelicaName() + " disconnected.");
    }

}

From source file:com.taobao.weex.dom.WXRecyclerDomObject.java

@Override
public float getStyleWidth() {
    float width = getLayoutWidth();
    if (Float.isNaN(width) || width <= 0) {
        if (getParent() != null) {
            width = getParent().getLayoutWidth();
        }/* w w w  . java2 s  .c o m*/
        if (Float.isNaN(width) || width <= 0) {
            width = super.getStyleWidth();
        }
    }
    if (Float.isNaN(width) || width <= 0) {
        width = getViewPortWidth();
    }
    return width;
}

From source file:org.briljantframework.data.Is.java

/**
 * Check if value is NA// ww w  .j a va  2  s.com
 *
 * @param value the value
 * @return true if value is NA
 */
public static boolean NA(float value) {
    return Float.isNaN(value) && (Float.floatToRawIntBits(value) & Na.FLOAT_NA_MASK) == Na.FLOAT_NA_RES;
}

From source file:de.tudarmstadt.ukp.teaching.uima.nounDecompounding.ranking.MutualInformationBased.java

@Override
public List<Split> rank(List<Split> splits) {
    for (Split split : splits) {
        split.setWeight(this.calcRank(split));
    }/*from   w w w. j a v  a 2s  . c o m*/

    List<Split> filtered = new ArrayList<Split>();
    for (Split split : splits) {
        if (!(Float.isInfinite(split.getWeight()) || Float.isNaN(split.getWeight()))) {
            filtered.add(split);
        }
    }

    if (filtered.size() == 0) {
        filtered = splits;
    }

    Collections.sort(filtered);
    return filtered;
}

From source file:Main.java

/**
 * Returns <code>true</code> if the specified number is a
 * Not-a-Number (NaN) value, <code>false</code> otherwise.
 *
 * <p>Note that this method is equivalent to the {@link
 * Float#isNaN(float) Float.isNaN} method; the functionality is
 * included in this class for convenience.
 *
 * @param   f   the value to be tested./*from w ww  .j a v a2 s  .c  o  m*/
 * @return  <code>true</code> if the argument is NaN;
 *          <code>false</code> otherwise.
 */
public static boolean isNaN(float f) {
    return Float.isNaN(f);
}