Elixir XDR v0.1.5 XDR.DoubleFloat View Source

This module manages the Double-Precision Floating-Point type based on the RFC4506 XDR Standard.

Link to this section Summary

Types

t()

XDR.DoubleFloat struct type specification.

Functions

Decode the Double-Precision Floating-Point in XDR format to a XDR.DoubleFloat structure.

Decode the Double-Precision Floating-Point in XDR format to a XDR.DoubleFloat structure. If the binaries are not valid, an exception is raised.

Encode a XDR.DoubleFloat structure into a XDR format.

Encode a XDR.DoubleFloat structure into a XDR format. If the double_float is not valid, an exception is raised.

Create a new XDR.DoubleFloat structure from the float passed.

Link to this section Types

Specs

t() :: %XDR.DoubleFloat{float: integer() | float() | binary()}

XDR.DoubleFloat struct type specification.

Link to this section Functions

Link to this function

decode_xdr(bytes, double_float \\ nil)

View Source

Specs

decode_xdr(bytes :: binary(), double_float :: t()) ::
  {:ok, {t(), binary()}} | {:error, :not_binary}

Decode the Double-Precision Floating-Point in XDR format to a XDR.DoubleFloat structure.

Link to this function

decode_xdr!(bytes, double_float \\ nil)

View Source

Specs

decode_xdr!(bytes :: binary(), double_float :: t()) :: {t(), binary()}

Decode the Double-Precision Floating-Point in XDR format to a XDR.DoubleFloat structure. If the binaries are not valid, an exception is raised.

Link to this function

encode_xdr(double_float)

View Source

Specs

encode_xdr(double_float :: t()) :: {:ok, binary()} | {:error, :not_number}

Encode a XDR.DoubleFloat structure into a XDR format.

Link to this function

encode_xdr!(double_float)

View Source

Specs

encode_xdr!(double_float :: t()) :: binary()

Encode a XDR.DoubleFloat structure into a XDR format. If the double_float is not valid, an exception is raised.

Specs

new(float :: float() | integer() | binary()) :: t()

Create a new XDR.DoubleFloat structure from the float passed.

Link to this macro

valid_float?(value)

View Source (macro)