Example usage for java.lang Number floatValue

List of usage examples for java.lang Number floatValue

Introduction

In this page you can find the example usage for java.lang Number floatValue.

Prototype

public abstract float floatValue();

Source Link

Document

Returns the value of the specified number as a float .

Usage

From source file:org.nd4j.linalg.factory.Nd4j.java

/**
 * Create double based on real and imaginary
 *
 * @param real real component/*from  w ww .j a  v a  2 s.  c  o m*/
 * @param imag imag component
 * @return
 */
public static IComplexNumber createComplexNumber(Number real, Number imag) {
    if (dataType() == DataBuffer.Type.FLOAT)
        return INSTANCE.createFloat(real.floatValue(), imag.floatValue());
    return INSTANCE.createDouble(real.doubleValue(), imag.doubleValue());

}