xdr v0.1.2 XDR.Type.Float View Source

RFC 4506, Section 4.6 - Single-precision Floating Point

Link to this section Summary

Types

t()

Single-precision float

Functions

Decodes a 4-byte binary into an single-precision float

Encodes a single-precision float or integer into a 4-byte binary

Determines if a value is a valid 4-byte float or integer

Link to this section Types

Single-precision float

Link to this section Functions

Link to this function decode(xdr) View Source
decode(xdr :: xdr()) ::
  {:ok, {float :: t(), rest :: XDR.Type.Base.xdr()}} |
  {:error, :invalid | :out_of_bounds}

Decodes a 4-byte binary into an single-precision float

Link to this function encode(float) View Source
encode(float :: t()) :: {:ok, xdr :: xdr()} | {:error, :invalid}

Encodes a single-precision float or integer into a 4-byte binary

Link to this function valid?(float) View Source
valid?(float :: t()) :: boolean()

Determines if a value is a valid 4-byte float or integer