Example usage for java.lang Float floatToIntBits

List of usage examples for java.lang Float floatToIntBits

Introduction

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

Prototype

@HotSpotIntrinsicCandidate
public static int floatToIntBits(float value) 

Source Link

Document

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

Usage

From source file:uk.co.modularaudio.mads.base.interptester.ui.InterpTesterMadUiInstance.java

public void setValue(final float newValue) {
    //      log.debug("Received new value: " + MathFormatter.slowFloatPrint( newValue, 5, true ) );

    final int intBits = Float.floatToIntBits(newValue);
    sendTemporalValueToInstance(InterpTesterIOQueueBridge.COMMAND_AMP, intBits);
    sendCommandValueToInstance(InterpTesterIOQueueBridge.COMMAND_AMP_NOTS, intBits);

    //      long curTimestamp = System.nanoTime();
    //      log.debug("Sending new value at timestamp " + curTimestamp );
}

From source file:at.alladin.rmbt.statisticServer.StatisticParameters.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((lang == null) ? 0 : lang.hashCode());
    result = prime * result + maxDevices;
    result = prime * result + duration;//from  w ww . jav a 2 s .  co m
    result = prime * result + ((networkTypeGroup == null) ? 0 : networkTypeGroup.hashCode());
    result = prime * result + Float.floatToIntBits(quantile);
    result = prime * result + ((type == null) ? 0 : type.hashCode());
    result = prime * result + ((accuracy == -1) ? 0 : (int) accuracy);
    result = prime * result + ((country == null) ? 0 : country.hashCode());
    return result;
}

From source file:org.paxle.se.index.lucene.impl.Converter.java

private static Fieldable number2field(org.paxle.core.doc.Field<?> field, Number data) {
    /* ===========================================================
     * Numbers// w  w w.j  a v a  2 s . c o m
     * - may be stored (if so, not compressed)
     * - may be indexed (no tokenization)
     * - no term vectors
     * =========================================================== */
    final long num;
    if (data instanceof Double) {
        num = Double.doubleToLongBits(data.doubleValue());
    } else if (data instanceof Float) {
        num = Float.floatToIntBits(data.floatValue());
    } else {
        num = data.longValue();
    }

    if (field.isIndex()) {
        return new Field(field.getName(), PaxleNumberTools.longToString(num), store(field, false),
                index(field));
    } else {
        return new Field(field.getName(), PaxleNumberTools.toBytes(num), store(field, false));
    }
}

From source file:uk.co.modularaudio.mads.base.djeq.ui.DJEQMadUiInstance.java

private void recalculateMid() {
    final float ampToSend = (curMidKilled ? 0.0f : curMidAmp);
    final long lValue = Float.floatToIntBits(ampToSend);
    sendTemporalValueToInstance(DJEQIOQueueBridge.COMMAND_IN_BP_AMP, lValue);
}

From source file:parquet.column.statistics.bloomfilter.BloomFilter.java

public boolean testFloat(float val) {
    return testInteger(Float.floatToIntBits(val));
}

From source file:uk.co.modularaudio.mads.base.imixern.ui.MixerNMadUiInstance.java

public void sendLaneAmp(final int laneNumber, final float newValue) {
    final long floatIntBits = Float.floatToIntBits(newValue);
    final long joinedParts = (floatIntBits << 32) | laneNumber;
    sendTemporalValueToInstance(MixerNIOQueueBridge.COMMAND_IN_LANE_AMP, joinedParts);
}

From source file:org.diorite.utils.math.FloatRange.java

@Override
public int hashCode() {
    int result = ((this.min != +0.0f) ? Float.floatToIntBits(this.min) : 0);
    result = (31 * result) + ((this.max != +0.0f) ? Float.floatToIntBits(this.max) : 0);
    return result;
}

From source file:org.diorite.ImmutableLocation.java

@Override
public int hashCode() {
    int result;/*w  ww.j  a  v  a  2 s . c o  m*/
    long temp;
    temp = Double.doubleToLongBits(this.x);
    result = (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(this.y);
    result = (31 * result) + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(this.z);
    result = (31 * result) + (int) (temp ^ (temp >>> 32));
    result = (31 * result) + ((this.yaw != +0.0f) ? Float.floatToIntBits(this.yaw) : 0);
    result = (31 * result) + ((this.pitch != +0.0f) ? Float.floatToIntBits(this.pitch) : 0);
    return result;
}

From source file:uk.co.modularaudio.mads.base.djeq.ui.DJEQMadUiInstance.java

private void recalculateLow() {
    final float ampToSend = (curLowKilled ? 0.0f : curLowAmp);
    final long lValue = Float.floatToIntBits(ampToSend);
    sendTemporalValueToInstance(DJEQIOQueueBridge.COMMAND_IN_LP_AMP, lValue);
}

From source file:net.sf.jclal.util.random.Ranlux.java

@Override
public int hashCode() {
    int hash = 3;
    hash = 53 * hash + this.nskip;
    hash = 53 * hash + Float.floatToIntBits(this.twom24);
    hash = 53 * hash + Float.floatToIntBits(this.twom12);
    hash = 53 * hash + this.i24;
    hash = 53 * hash + this.j24;
    hash = 53 * hash + this.in24;
    hash = 53 * hash + this.kount;
    hash = 53 * hash + Float.floatToIntBits(this.carry);
    hash = 53 * hash + Arrays.hashCode(this.seeds);
    return hash;//from  ww w. j  av  a2 s.  co  m
}