pub struct FormatComplex {
pub real: f64,
pub imag: f64,
}Expand description
A Display adapter writing a complex number as CPython’s
repr()/str(): (1+2j), 1j, (-0-1j), (nan+infj).
Each part is the FormatFloat rendering with an integral value’s .0
dropped (1.0 → 1, but 1e+16 stays). A real part that is exactly +0.0
is omitted along with the parentheses, so complex(0, 1) is 1j while
complex(-0.0, 1) is (-0+1j). Allocation-free like FormatFloat.
Fields§
§real: f64The real part.
imag: f64The imaginary part.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FormatComplex
impl RefUnwindSafe for FormatComplex
impl Send for FormatComplex
impl Sync for FormatComplex
impl Unpin for FormatComplex
impl UnsafeUnpin for FormatComplex
impl UnwindSafe for FormatComplex
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