XDR kommit v0.1.0 XDR.Float View Source

This module is in charge of process the Single-Precision Floating-Point types based on the RFC4506 XDR Standard

Link to this section Summary

Types

t()

Every float structure has a float which represent the Single-Precision Floating-Point value which you try to encode

Functions

This function is in charge of decode the XDR value which represents an Floating Point value if the parameters are wrong an error will be raised, it receives an XDR.Float structure which contains the binary to decode

This function is in charge of decode the XDR value which represents an Floating Point value if the parameters are wrong an error will be raised, it receives an XDR.Float structure which contains the binary to decode

this function is in charge of encoding a Floating Point value into an XDR if the parameters are wrong an error will be raised, it receives an XDR.Float structure which contains the float value to encode

this function is in charge of encoding a Floating Point value into an XDR if the parameters are wrong an error will be raised, it receives an XDR.Float structure which contains the float value to encode

this function provides an easy way to create an XDR.Float type

Link to this section Types

Specs

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

Every float structure has a float which represent the Single-Precision Floating-Point value which you try to encode

Link to this section Functions

Link to this function

decode_xdr(bytes, opts \\ nil)

View Source

Specs

decode_xdr(bytes :: binary(), opts :: any()) :: {:ok, {t(), binary()}}

This function is in charge of decode the XDR value which represents an Floating Point value if the parameters are wrong an error will be raised, it receives an XDR.Float structure which contains the binary to decode

Returns a tuple with the Floating Point resulted from decode the XDR value and its remaining bits

Link to this function

decode_xdr!(bytes, opts \\ nil)

View Source

Specs

decode_xdr!(bytes :: binary(), opts :: any()) :: {t(), binary()}

This function is in charge of decode the XDR value which represents an Floating Point value if the parameters are wrong an error will be raised, it receives an XDR.Float structure which contains the binary to decode

Returns the Floating Point resulted from decode the XDR value and its remaining bits

Specs

encode_xdr(t()) :: {:ok, binary()}

this function is in charge of encoding a Floating Point value into an XDR if the parameters are wrong an error will be raised, it receives an XDR.Float structure which contains the float value to encode

Returns a tuple with the XDR resulted from encoding the Floating Point value

Specs

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

this function is in charge of encoding a Floating Point value into an XDR if the parameters are wrong an error will be raised, it receives an XDR.Float structure which contains the float value to encode

Returns the XDR resulted from encoding the Floating Point value

Specs

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

this function provides an easy way to create an XDR.Float type

returns a XDR.Float struct with the value received as parameter

Link to this macro

valid_float?(value)

View Source (macro)