pub struct Complex {
pub re: f64,
pub im: f64,
}Expand description
Uiua’s complex number type
Fields§
§re: f64The real part
im: f64The 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 ArrayValue for Complex
impl ArrayValue for Complex
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§impl DebugArrayValue for Complex
impl DebugArrayValue for Complex
source§fn debug_string(&self, depth: usize, prefix: bool) -> String
fn debug_string(&self, depth: usize, prefix: bool) -> String
String representation that can be read by the interpreter
source§fn debug_delims() -> (&'static str, &'static str)
fn debug_delims() -> (&'static str, &'static str)
Row delimiters that can be read by the interpreter
source§fn debug_separator() -> &'static str
fn debug_separator() -> &'static str
Separator that can be read by the interpreter
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 FromIterator<Complex> for Value
impl FromIterator<Complex> for Value
source§impl PartialEq for Complex
impl PartialEq for Complex
source§impl PartialOrd for Complex
impl PartialOrd for Complex
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for Complex
impl StructuralPartialEq for Complex
Auto Trait Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§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().