Half

inline class Half(val rawBits: UShort)

Represents a floating point value of 16 bits. Also known as Half-precision floating-point format (IEEE 754-2008). This is an inline class backed by a UShort. No operations defined for this class, you should convert from and into other values. To get its internal representation, call the toRawBits function.

Mantissa/fraction: 10 bits Exponent: 5 bits Sign: 1 bit

Formula: (2**(exp)) * (1 + mantissa/1024)

Significance: stored 10 bits (but can achieve 11 bits of integral precision)

See also

Constructors

Link copied to clipboard
constructor(rawBits: UShort)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
operator fun div(that: Half): Half
Link copied to clipboard
operator fun minus(that: Half): Half
Link copied to clipboard
operator fun plus(that: Half): Half
Link copied to clipboard
operator fun rem(that: Half): Half
Link copied to clipboard
operator fun times(that: Half): Half
Link copied to clipboard
fun toBits(): UShort

Return the internal bits representation (16-bits) as UShort

Link copied to clipboard
Link copied to clipboard
fun toFloat(): Float
Link copied to clipboard

Converts value into Half

Link copied to clipboard

Return the internal bits representation (16-bits) as UShort

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
operator fun unaryMinus(): Half
Link copied to clipboard
operator fun unaryPlus(): Half