Half

fun Half(value: Double): Half(source)

Converts the specified double-precision float value into a half-precision float value. The following special cases are handled:

Return

A half-precision float value

Parameters

value

The double-precision float value to convert to half-precision


fun Half(value: Float): Half(source)

Converts the specified single-precision float value into a half-precision float value. The following special cases are handled:

Return

A half-precision float value

Parameters

value

The single-precision float value to convert to half-precision


fun Half(value: String): Half(source)

Returns the half-precision float value represented by the specified string. The string is converted to a half-precision float value as if by the String.toFloat() method.

Calling this function is equivalent to calling:

Half(value.toFloat())

See also

Parameters

value

A string to be converted to a {@code Half}

Throws

if the string does not contain a parsable number