Float16

object Float16

Logic for converting half-precision (16-bit) floats to and from bytes.

Source: https://stackoverflow.com/questions/6162651 (The author says it's public domain.)

The documented author's "extensions" have been removed for clean round-tripping to and from Float.

Companion:
class
trait Product
trait Mirror
class Object
trait Matchable
class Any
Float16.type

Type members

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from:
Mirror

Value members

Concrete methods

def floatToShort(value: Float): Int

Result has only low-word set.

Result has only low-word set.

def shortToFloat(hbits: Int): Float

Hi-word of parameter value is ignored.

Hi-word of parameter value is ignored.

Implicits

Implicits

implicit val codec: Codec[Float16]