pub struct CBig<R: Round = Zero, const B: Word = 2> { /* private fields */ }Expand description
An arbitrary-precision complex number with arbitrary base and rounding mode.
The complex number consists of two Repr parts (the real part re and the imaginary part
im) over a single shared Context. Each part keeps its own significand
length; the shared context holds the precision cap and rounding mode applied independently to
both components.
§Generic parameters
The const generic parameters are abbreviated as BASE -> B, RoundingMode -> R. The BASE
must be in range [2, isize::MAX], and the rounding mode R is chosen from the
dashu_float::round::mode module. With the defaults the number is base 2 rounded towards zero
(matching FBig’s default).
§Rounding
Each component of a result is rounded independently with the single mode R, after the operation
feeds each part enough guard precision. CBig follows the C99 Annex G / Kahan model and has no
NaN; see the compliance guide
for the full error policy.
§Examples
use dashu_cmplx::CBig;
use dashu_float::{FBig, round::mode::HalfAway};
// base-10 so each integer keeps its own significand
let z = CBig::<HalfAway, 10>::from_parts(FBig::from(3), FBig::from(4));
assert_eq!(z.re().significand(), &3.into());
assert_eq!(z.im().significand(), &4.into());Implementations§
Source§impl<R: Round, const B: Word> CBig<R, B>
impl<R: Round, const B: Word> CBig<R, B>
Sourcepub const fn new(re: Repr<B>, im: Repr<B>, context: Context<R>) -> Self
pub const fn new(re: Repr<B>, im: Repr<B>, context: Context<R>) -> Self
Create a CBig from raw parts (a const-capable constructor, the complex analog of
dashu_float::FBig::from_repr_const). Used by the static_cbig! literal macro and
internal code; in most cases prefer CBig::from_parts.
Sourcepub fn from_parts(re: FBig<R, B>, im: FBig<R, B>) -> Self
pub fn from_parts(re: FBig<R, B>, im: FBig<R, B>) -> Self
Create a CBig from its real and imaginary parts.
The result context is max(re.context(), im.context()) (the larger precision wins; an
unlimited 0 precision is treated as the minimum, so a limited operand’s precision wins),
and the smaller-precision part is effectively widened to it — widening is exact, so only the
precision cap changes. The rounding mode and base must match and are enforced by the type
parameters.
§Examples
use dashu_cmplx::CBig;
use dashu_float::{FBig, round::mode::HalfAway};
type C = CBig<HalfAway, 10>;
type F = FBig<HalfAway, 10>;
let z = C::from_parts(F::from(3), F::from(4));
let (re, im) = z.into_parts();
assert_eq!(re, F::from(3));
assert_eq!(im, F::from(4));Sourcepub const fn precision(&self) -> usize
pub const fn precision(&self) -> usize
Get the precision limit of the complex number (0 = unlimited). Both parts share it.
Sourcepub fn into_parts(self) -> (FBig<R, B>, FBig<R, B>)
pub fn into_parts(self) -> (FBig<R, B>, FBig<R, B>)
Convert the complex number into its real and imaginary parts as FBigs, each carrying the
(copied) shared context — zero clone of the significands.
Sourcepub fn is_zero(&self) -> bool
pub fn is_zero(&self) -> bool
Determine if the complex number is numerically zero (both parts ±0).
Sourcepub fn is_infinite(&self) -> bool
pub fn is_infinite(&self) -> bool
Determine if either part of the complex number is infinite.
Source§impl<R: Round, const B: Word> CBig<R, B>
impl<R: Round, const B: Word> CBig<R, B>
Sourcepub fn into_cached(self, cache: Rc<RefCell<ConstCache>>) -> CachedCBig<R, B>
pub fn into_cached(self, cache: Rc<RefCell<ConstCache>>) -> CachedCBig<R, B>
Attach a shared cache handle, turning this CBig into a CachedCBig.
Source§impl<R: Round, const B: Word> CBig<R, B>
impl<R: Round, const B: Word> CBig<R, B>
Sourcepub fn exp(&self) -> Self
pub fn exp(&self) -> Self
Complex exponential e^z (convenience layer).
§Panics
Panics if the precision is unlimited or on an indeterminate special value.
Source§impl<R: Round, const B: Word> CBig<R, B>
impl<R: Round, const B: Word> CBig<R, B>
Sourcepub fn sin(&self) -> Self
pub fn sin(&self) -> Self
Complex sine (convenience layer). Panics on an indeterminate special value.
Sourcepub fn cos(&self) -> Self
pub fn cos(&self) -> Self
Complex cosine (convenience layer). Panics on an indeterminate special value.
Source§impl<R: Round, const B: Word> CBig<R, B>
impl<R: Round, const B: Word> CBig<R, B>
Sourcepub fn conj(&self) -> Self
pub fn conj(&self) -> Self
The complex conjugate x - iy. Exact (sign flip of the imaginary part, including -0/-inf).
Sourcepub fn proj(&self) -> Self
pub fn proj(&self) -> Self
Project onto the Riemann sphere (proj): any part-infinite value maps to +∞ + i·0 (the
imaginary zero carrying the sign of the original imaginary part); finite values are unchanged.
Sourcepub fn mul_i(&self, negative: bool) -> Self
pub fn mul_i(&self, negative: bool) -> Self
Multiply by ±i (exact rotation): ×i maps (re, im) -> (-im, re), ×(-i) maps
(re, im) -> (im, -re).
Trait Implementations§
Source§impl<'r, R: Round, const B: Word> Add<&'r CachedCBig<R, B>> for CBig<R, B>
impl<'r, R: Round, const B: Word> Add<&'r CachedCBig<R, B>> for CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
+ operator.Source§impl<'l, 'r, R: Round, const B: Word> Add<&'r CachedCBig<R, B>> for &'l CBig<R, B>
impl<'l, 'r, R: Round, const B: Word> Add<&'r CachedCBig<R, B>> for &'l CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
+ operator.Source§impl<R: Round, const B: Word> Add<CachedCBig<R, B>> for CBig<R, B>
impl<R: Round, const B: Word> Add<CachedCBig<R, B>> for CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
+ operator.Source§impl<'l, R: Round, const B: Word> Add<CachedCBig<R, B>> for &'l CBig<R, B>
impl<'l, R: Round, const B: Word> Add<CachedCBig<R, B>> for &'l CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
+ operator.Source§impl<R: Round, const B: Word> AddAssign for CBig<R, B>
impl<R: Round, const B: Word> AddAssign for CBig<R, B>
Source§fn add_assign(&mut self, rhs: CBig<R, B>)
fn add_assign(&mut self, rhs: CBig<R, B>)
+= operation. Read moreSource§impl<R: Round, const B: Word> AddAssign<&CBig<R, B>> for CBig<R, B>
impl<R: Round, const B: Word> AddAssign<&CBig<R, B>> for CBig<R, B>
Source§fn add_assign(&mut self, rhs: &CBig<R, B>)
fn add_assign(&mut self, rhs: &CBig<R, B>)
+= operation. Read moreSource§impl<R: Round, const B: Word> AddAssign<&CBig<R, B>> for CachedCBig<R, B>
impl<R: Round, const B: Word> AddAssign<&CBig<R, B>> for CachedCBig<R, B>
Source§fn add_assign(&mut self, rhs: &CBig<R, B>)
fn add_assign(&mut self, rhs: &CBig<R, B>)
+= operation. Read moreSource§impl<R: Round, const B: Word> AddAssign<CBig<R, B>> for CachedCBig<R, B>
impl<R: Round, const B: Word> AddAssign<CBig<R, B>> for CachedCBig<R, B>
Source§fn add_assign(&mut self, rhs: CBig<R, B>)
fn add_assign(&mut self, rhs: CBig<R, B>)
+= operation. Read moreSource§impl<R: Round, const B: Word> Display for CBig<R, B>
impl<R: Round, const B: Word> Display for CBig<R, B>
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Format in algebraic a+bi form: "1+2i", "-3-4i", "5" (pure real), "-7i" (pure
imaginary), "i" (0+1i), "-i" (0-1i). The imaginary term always carries an explicit
sign, a unit coefficient is elided, and a zero imaginary is omitted. Each coefficient uses
FBig’s native Display (specials render as inf / -inf).
Source§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for UniformCBig<R, B>
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for UniformCBig<R, B>
Source§fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
T, using rng as the source of randomness.Source§fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
T, using rng as
the source of randomness. Read moreSource§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for Standard
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for Standard
Source§fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
Each part uniform in [0, 1) → the unit square [0, 1)², at inline precision.
Source§fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
T, using rng as
the source of randomness. Read moreSource§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for Open01
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for Open01
Source§fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
T, using rng as the source of randomness.Source§fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
T, using rng as
the source of randomness. Read moreSource§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for OpenClosed01
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for OpenClosed01
Source§fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
T, using rng as the source of randomness.Source§fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
T, using rng as
the source of randomness. Read moreSource§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for UniformCBig<R, B>
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for UniformCBig<R, B>
Source§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for StandardUniform
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for StandardUniform
Source§fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
Each part uniform in [0, 1) → the unit square [0, 1)², at inline precision.
Source§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
T, using rng as
the source of randomness. Read moreSource§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for Open01
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for Open01
Source§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for OpenClosed01
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for OpenClosed01
Source§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for UniformCBig<R, B>
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for UniformCBig<R, B>
Source§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for StandardUniform
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for StandardUniform
Source§fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
fn sample<RNG: Rng + ?Sized>(&self, rng: &mut RNG) -> CBig<R, B>
Each part uniform in [0, 1) → the unit square [0, 1)², at inline precision.
Source§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
T, using rng as
the source of randomness. Read moreSource§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for Open01
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for Open01
Source§impl<R: Round, const B: Word> Distribution<CBig<R, B>> for OpenClosed01
impl<R: Round, const B: Word> Distribution<CBig<R, B>> for OpenClosed01
Source§impl<'r, R: Round, const B: Word> Div<&'r CachedCBig<R, B>> for CBig<R, B>
impl<'r, R: Round, const B: Word> Div<&'r CachedCBig<R, B>> for CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
/ operator.Source§impl<'l, 'r, R: Round, const B: Word> Div<&'r CachedCBig<R, B>> for &'l CBig<R, B>
impl<'l, 'r, R: Round, const B: Word> Div<&'r CachedCBig<R, B>> for &'l CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
/ operator.Source§impl<R: Round, const B: Word> Div<CachedCBig<R, B>> for CBig<R, B>
impl<R: Round, const B: Word> Div<CachedCBig<R, B>> for CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
/ operator.Source§impl<'l, R: Round, const B: Word> Div<CachedCBig<R, B>> for &'l CBig<R, B>
impl<'l, R: Round, const B: Word> Div<CachedCBig<R, B>> for &'l CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
/ operator.Source§impl<R: Round, const B: Word> DivAssign for CBig<R, B>
impl<R: Round, const B: Word> DivAssign for CBig<R, B>
Source§fn div_assign(&mut self, rhs: CBig<R, B>)
fn div_assign(&mut self, rhs: CBig<R, B>)
/= operation. Read moreSource§impl<R: Round, const B: Word> DivAssign<&CBig<R, B>> for CachedCBig<R, B>
impl<R: Round, const B: Word> DivAssign<&CBig<R, B>> for CachedCBig<R, B>
Source§fn div_assign(&mut self, rhs: &CBig<R, B>)
fn div_assign(&mut self, rhs: &CBig<R, B>)
/= operation. Read moreSource§impl<R: Round, const B: Word> DivAssign<&CBig<R, B>> for CBig<R, B>
impl<R: Round, const B: Word> DivAssign<&CBig<R, B>> for CBig<R, B>
Source§fn div_assign(&mut self, rhs: &CBig<R, B>)
fn div_assign(&mut self, rhs: &CBig<R, B>)
/= operation. Read moreSource§impl<R: Round, const B: Word> DivAssign<CBig<R, B>> for CachedCBig<R, B>
impl<R: Round, const B: Word> DivAssign<CBig<R, B>> for CachedCBig<R, B>
Source§fn div_assign(&mut self, rhs: CBig<R, B>)
fn div_assign(&mut self, rhs: CBig<R, B>)
/= operation. Read moreimpl<R: Round, const B: Word> Eq for CBig<R, B>
Source§impl<R: Round, const B: Word> From<CachedCBig<R, B>> for CBig<R, B>
impl<R: Round, const B: Word> From<CachedCBig<R, B>> for CBig<R, B>
Source§fn from(cached: CachedCBig<R, B>) -> Self
fn from(cached: CachedCBig<R, B>) -> Self
Source§impl<'r, R: Round, const B: Word> Mul<&'r CachedCBig<R, B>> for CBig<R, B>
impl<'r, R: Round, const B: Word> Mul<&'r CachedCBig<R, B>> for CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
* operator.Source§impl<'l, 'r, R: Round, const B: Word> Mul<&'r CachedCBig<R, B>> for &'l CBig<R, B>
impl<'l, 'r, R: Round, const B: Word> Mul<&'r CachedCBig<R, B>> for &'l CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
* operator.Source§impl<R: Round, const B: Word> Mul<CachedCBig<R, B>> for CBig<R, B>
impl<R: Round, const B: Word> Mul<CachedCBig<R, B>> for CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
* operator.Source§impl<'l, R: Round, const B: Word> Mul<CachedCBig<R, B>> for &'l CBig<R, B>
impl<'l, R: Round, const B: Word> Mul<CachedCBig<R, B>> for &'l CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
* operator.Source§impl<R: Round, const B: Word> MulAssign for CBig<R, B>
impl<R: Round, const B: Word> MulAssign for CBig<R, B>
Source§fn mul_assign(&mut self, rhs: CBig<R, B>)
fn mul_assign(&mut self, rhs: CBig<R, B>)
*= operation. Read moreSource§impl<R: Round, const B: Word> MulAssign<&CBig<R, B>> for CachedCBig<R, B>
impl<R: Round, const B: Word> MulAssign<&CBig<R, B>> for CachedCBig<R, B>
Source§fn mul_assign(&mut self, rhs: &CBig<R, B>)
fn mul_assign(&mut self, rhs: &CBig<R, B>)
*= operation. Read moreSource§impl<R: Round, const B: Word> MulAssign<&CBig<R, B>> for CBig<R, B>
impl<R: Round, const B: Word> MulAssign<&CBig<R, B>> for CBig<R, B>
Source§fn mul_assign(&mut self, rhs: &CBig<R, B>)
fn mul_assign(&mut self, rhs: &CBig<R, B>)
*= operation. Read moreSource§impl<R: Round, const B: Word> MulAssign<CBig<R, B>> for CachedCBig<R, B>
impl<R: Round, const B: Word> MulAssign<CBig<R, B>> for CachedCBig<R, B>
Source§fn mul_assign(&mut self, rhs: CBig<R, B>)
fn mul_assign(&mut self, rhs: CBig<R, B>)
*= operation. Read moreSource§impl<R1: Round, R2: Round, const B: Word> NumOrd<CBig<R2, B>> for CBig<R1, B>
impl<R1: Round, R2: Round, const B: Word> NumOrd<CBig<R2, B>> for CBig<R1, B>
Source§impl<R: Round, const B: Word> Ord for CBig<R, B>
impl<R: Round, const B: Word> Ord for CBig<R, B>
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Lexicographic total order by (re, then im). Special values are placed consistently with
FBig (-∞ < finite < +∞ per component).
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<R1: Round, R2: Round, const B: Word> PartialOrd<CBig<R2, B>> for CBig<R1, B>
impl<R1: Round, R2: Round, const B: Word> PartialOrd<CBig<R2, B>> for CBig<R1, B>
Source§impl<'r, R: Round, const B: Word> Sub<&'r CachedCBig<R, B>> for CBig<R, B>
impl<'r, R: Round, const B: Word> Sub<&'r CachedCBig<R, B>> for CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
- operator.Source§impl<'l, 'r, R: Round, const B: Word> Sub<&'r CachedCBig<R, B>> for &'l CBig<R, B>
impl<'l, 'r, R: Round, const B: Word> Sub<&'r CachedCBig<R, B>> for &'l CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
- operator.Source§impl<R: Round, const B: Word> Sub<CachedCBig<R, B>> for CBig<R, B>
impl<R: Round, const B: Word> Sub<CachedCBig<R, B>> for CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
- operator.Source§impl<'l, R: Round, const B: Word> Sub<CachedCBig<R, B>> for &'l CBig<R, B>
impl<'l, R: Round, const B: Word> Sub<CachedCBig<R, B>> for &'l CBig<R, B>
Source§type Output = CachedCBig<R, B>
type Output = CachedCBig<R, B>
- operator.Source§impl<R: Round, const B: Word> SubAssign for CBig<R, B>
impl<R: Round, const B: Word> SubAssign for CBig<R, B>
Source§fn sub_assign(&mut self, rhs: CBig<R, B>)
fn sub_assign(&mut self, rhs: CBig<R, B>)
-= operation. Read moreSource§impl<R: Round, const B: Word> SubAssign<&CBig<R, B>> for CBig<R, B>
impl<R: Round, const B: Word> SubAssign<&CBig<R, B>> for CBig<R, B>
Source§fn sub_assign(&mut self, rhs: &CBig<R, B>)
fn sub_assign(&mut self, rhs: &CBig<R, B>)
-= operation. Read moreSource§impl<R: Round, const B: Word> SubAssign<&CBig<R, B>> for CachedCBig<R, B>
impl<R: Round, const B: Word> SubAssign<&CBig<R, B>> for CachedCBig<R, B>
Source§fn sub_assign(&mut self, rhs: &CBig<R, B>)
fn sub_assign(&mut self, rhs: &CBig<R, B>)
-= operation. Read moreSource§impl<R: Round, const B: Word> SubAssign<CBig<R, B>> for CachedCBig<R, B>
impl<R: Round, const B: Word> SubAssign<CBig<R, B>> for CachedCBig<R, B>
Source§fn sub_assign(&mut self, rhs: CBig<R, B>)
fn sub_assign(&mut self, rhs: CBig<R, B>)
-= operation. Read moreSource§impl<R: Round, const B: Word> TryFrom<CBig<R, B>> for FBig<R, B>
impl<R: Round, const B: Word> TryFrom<CBig<R, B>> for FBig<R, B>
Source§fn try_from(z: CBig<R, B>) -> Result<Self, Self::Error>
fn try_from(z: CBig<R, B>) -> Result<Self, Self::Error>
Extract the real part, succeeding only when the imaginary part is zero (purely real; both
±0 count as zero). This is the guarded “is this complex actually real?” check — distinct
from CBig::re / CBig::into_parts, which return the real part unconditionally.
Source§type Error = ConversionError
type Error = ConversionError
Source§impl<R: Round, const B: Word> TryFrom<CBig<R, B>> for IBig
impl<R: Round, const B: Word> TryFrom<CBig<R, B>> for IBig
Source§fn try_from(z: CBig<R, B>) -> Result<Self, Self::Error>
fn try_from(z: CBig<R, B>) -> Result<Self, Self::Error>
Extract an integer, succeeding only when the number is purely real, finite, and
integer-valued. Composes CBig → FBig → IBig; for a rounding-aware path use
FBig::to_int on the real part (CBig::re).
Source§type Error = ConversionError
type Error = ConversionError
Source§impl<R: Round> TryFrom<CBig<R>> for Complex32
impl<R: Round> TryFrom<CBig<R>> for Complex32
Source§impl<R: Round> TryFrom<CBig<R>> for Complex64
impl<R: Round> TryFrom<CBig<R>> for Complex64
Source§impl<R: Round> TryFrom<Complex<f32>> for CBig<R, 2>
impl<R: Round> TryFrom<Complex<f32>> for CBig<R, 2>
Source§fn try_from(c: Complex32) -> Result<Self, Self::Error>
fn try_from(c: Complex32) -> Result<Self, Self::Error>
Lift a primitive-float Complex to an exact base-2 CBig. A NaN part is
unmappable (CBig has no NaN) and yields ConversionError::OutOfBounds;
infinities and signed zeros are preserved, exactly as for FBig: TryFrom<f64>.
Source§type Error = ConversionError
type Error = ConversionError
Source§impl<R: Round> TryFrom<Complex<f64>> for CBig<R, 2>
impl<R: Round> TryFrom<Complex<f64>> for CBig<R, 2>
Source§fn try_from(c: Complex64) -> Result<Self, Self::Error>
fn try_from(c: Complex64) -> Result<Self, Self::Error>
Lift a primitive-float Complex to an exact base-2 CBig. A NaN part is
unmappable (CBig has no NaN) and yields ConversionError::OutOfBounds;
infinities and signed zeros are preserved, exactly as for FBig: TryFrom<f64>.