Packages

  • package root
    Definition Classes
    root
  • package fs2
    Definition Classes
    root
  • package data
    Definition Classes
    fs2
  • package cbor
    Definition Classes
    data
  • package high

    High-level representation and tools for CBOR data streams.

    High-level representation and tools for CBOR data streams.

    The high-level representation is less powerful as the low-level one, as it builds structured data. For instance it is not able to represent arrays of strings whose size is bigger than Int.MaxValue.

    The reprensentation is intended to be easier to work with if you need more structured data and don't exceed the underlying limits.

    Definition Classes
    cbor
  • package internal
    Definition Classes
    high
  • CborValue
  • HalfFloat
o

fs2.data.cbor.high

HalfFloat

object HalfFloat

HalfFloat represents 16-bit floating-point values.

This type does not actually support arithmetic directly. The expected use case is to convert to Float to perform any actual arithmetic, then convert back to a HalfFloat if needed.

Binary representation:

sign (1 bit) | | exponent (5 bits) | | | | mantissa (10 bits) | | | x xxxxx xxxxxxxxxx

Value interpretation (in order of precedence, with _ wild):

0 00000 0000000000 (positive) zero 1 00000 0000000000 negative zero _ 00000 subnormal number _ 11111 0000000000 +/- infinity _ 11111 not-a-number _ _ normal number

For non-zero exponents, the mantissa has an implied leading 1 bit, so 10 bits of data provide 11 bits of precision for normal numbers.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HalfFloat
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toFloat(raw: Short): Float

    Convert this HalfFloat value to the nearest Float.

    Convert this HalfFloat value to the nearest Float.

    Non-finite values and zero values will be mapped to the corresponding Float value.

    All other finite values will be handled depending on whether they are normal or subnormal. The relevant formulas are:

    * normal: (sign*2-1) * 2(exponent-15) * (1 + mantissa/1024) * subnormal: (sign*2-1) * 2-14 * (mantissa/1024)

    Given any (x: HalfFloat), HalfFloat.fromFloat(x.toFloat) = x

    The reverse is not necessarily true, since there are many Float values which are not precisely representable as HalfFloat values.

  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped