sci v0.0.2 Sci.Helpers.ComplexHelpers View Source

Helpers for dealing with complex numbers. Wraps the ComplexNum package.

Link to this section Summary

Functions

Determines whether a number is real, or a set of numbers is entirely composed of real numbers. True for a ComplexNum where the imaginary component is 0

Link to this section Functions

Determines whether a number is real, or a set of numbers is entirely composed of real numbers. True for a ComplexNum where the imaginary component is 0.

Examples

iex> Sci.Helpers.ComplexHelpers.real?(123)
true

iex> Sci.Helpers.ComplexHelpers.real?([123, 456])
true

iex> Sci.Helpers.ComplexHelpers.real?(ComplexNum.new(1))
true

iex> Sci.Helpers.ComplexHelpers.real?(ComplexNum.new(1, 1))
false

iex> Sci.Helpers.ComplexHelpers.real?([ComplexNum.new(1, 0), ComplexNum.new(2, -0.234)])
false