#[repr(C)]pub struct Complex {
pub re: f64,
pub im: f64,
}
Expand description
Uiua’s complex number type
Fields§
§re: f64
The real part
im: f64
The imaginary part
Implementations§
Source§impl Complex
impl Complex
Sourcepub fn min(self, rhs: impl Into<Self>) -> Self
pub fn min(self, rhs: impl Into<Self>) -> Self
Get the minimum of the real and imaginary parts of two complex numbers, ignoring NaN
Sourcepub fn max(self, rhs: impl Into<Self>) -> Self
pub fn max(self, rhs: impl Into<Self>) -> Self
Get the maximum of the real and imaginary parts of two complex numbers, ignoring NaN
Sourcepub fn from_polar(r: f64, theta: f64) -> Self
pub fn from_polar(r: f64, theta: f64) -> Self
Convert polar coordinates to a complex number
Trait Implementations§
Source§impl<T> AddAssign<T> for Complex
impl<T> AddAssign<T> for Complex
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+=
operation. Read moreSource§impl ArrayValue for Complex
impl ArrayValue for Complex
Source§fn get_scalar_fill(fill: &Fill<'_>) -> Result<Self, &'static str>
fn get_scalar_fill(fill: &Fill<'_>) -> Result<Self, &'static str>
Get the scalar fill value from the environment
Source§fn get_array_fill(fill: &Fill<'_>) -> Result<Array<Self>, &'static str>
fn get_array_fill(fill: &Fill<'_>) -> Result<Array<Self>, &'static str>
Get the array fill value from the environment
Source§fn array_hash<H: Hasher>(&self, hasher: &mut H)
fn array_hash<H: Hasher>(&self, hasher: &mut H)
Hash the value
Source§fn empty_list_inner() -> &'static str
fn empty_list_inner() -> &'static str
Marker for empty lists in grid formatting
Source§fn format_delims() -> (&'static str, &'static str)
fn format_delims() -> (&'static str, &'static str)
Delimiters for formatting
Source§fn format_sep() -> &'static str
fn format_sep() -> &'static str
Separator for formatting
Source§fn compress_list_grid() -> bool
fn compress_list_grid() -> bool
Whether to compress all items of a list when grid formatting
Source§fn nested_value(&self) -> Option<&Value>
fn nested_value(&self) -> Option<&Value>
Get a nested value
Source§fn has_wildcard(&self) -> bool
fn has_wildcard(&self) -> bool
Check if this element has the wildcard value
Source§fn summary_min_elems() -> usize
fn summary_min_elems() -> usize
The minimum number of elements that require a summary
Source§impl<'de> Deserialize<'de> for Complex
impl<'de> Deserialize<'de> for Complex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> DivAssign<T> for Complex
impl<T> DivAssign<T> for Complex
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/=
operation. Read moreSource§impl FromIterator<Complex> for Value
impl FromIterator<Complex> for Value
Source§impl<T> MulAssign<T> for Complex
impl<T> MulAssign<T> for Complex
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*=
operation. Read moreSource§impl PartialOrd for Complex
impl PartialOrd for Complex
Source§impl<T> SubAssign<T> for Complex
impl<T> SubAssign<T> for Complex
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
Performs the
-=
operation. Read moreimpl Copy for Complex
impl Eq for Complex
Auto Trait Implementations§
impl Freeze for Complex
impl RefUnwindSafe for Complex
impl Send for Complex
impl Sync for Complex
impl Unpin for Complex
impl UnwindSafe for Complex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.