View Source Vx.Float (Vx v0.1.0)

The Float type.

Summary

Types

t()

The float type.

Functions

t()

Builds a new Float type.

Types

@opaque t()

The float type.

Functions

@spec integer(t()) :: t()
@spec t() :: t()

Builds a new Float type.

Examples

iex> Vx.Float.t() |> Vx.validate!(1.0)
:ok

iex> Vx.Float.t() |> Vx.validate!(1)
** (Vx.Error) must be a float

iex> Vx.Float.t() |> Vx.validate!("foo")
** (Vx.Error) must be a float