ASDF.Complex (asdf v0.1.0)

Copy Markdown View Source

A complex number from complex64 or complex128.

real and imag follow the array's float width. complex128 stores Elixir floats. complex64 stores %ASDF.Float32{} unless ASDF.Array.to_list/2 is called with widen: true, which stores Elixir floats in both fields. float16 is not a complex component.

Examples

iex> z = %ASDF.Complex{real: 1.0, imag: -2.0}
...> {z.real, z.imag}
{1.0, -2.0}

Summary

Types

t()

One complex value.

Types

t()

@type t() :: %ASDF.Complex{
  imag: number() | ASDF.Float32.t(),
  real: number() | ASDF.Float32.t()
}

One complex value.

  • :real — real part, an Elixir number or an %ASDF.Float32{}
  • :imag — imaginary part, same type as :real