SqrtComplexErrors

Type Alias SqrtComplexErrors 

Source
pub type SqrtComplexErrors<RawComplex> = FunctionErrors<SqrtComplexInputErrors<RawComplex>, <RawComplex as RawScalarTrait>::ValidationErrors>;
Expand description

A type alias for FunctionErrors, specialized for errors that can occur during the computation of the square root of a complex number.

This type represents the possible failures when calling Sqrt::try_sqrt() on a complex number.

§Generic Parameters

  • RawComplex: A type that implements RawComplexTrait. This defines:
    • The raw error type for the input complex number via SqrtComplexInputErrors<RawComplex>.
    • The raw error type for the output complex number (the square root) also via <RawComplex as RawScalarTrait>::ValidationErrors.

§Variants

This type alias wraps FunctionErrors, which has the following variants in this context:

  • Input { source: SqrtComplexInputErrors<RawComplex> }: Indicates that the input complex number was invalid for square root computation. This is typically due to the complex number’s components (real or imaginary parts) failing general validation checks (e.g., NaN, Infinity, subnormal). The source field provides more specific details via SqrtComplexInputErrors.

  • Output { source: <RawComplex as RawScalarTrait>::ValidationErrors }: Indicates that the computed complex square root itself failed validation. This typically means the result of the sqrt operation yielded a complex number with non-finite components (NaN or Infinity), which is unexpected if the input was valid.

Aliased Type§

pub enum SqrtComplexErrors<RawComplex> {
    Input {
        source: SqrtComplexInputErrors<RawComplex>,
    },
    Output {
        source: <RawComplex as RawScalarTrait>::ValidationErrors,
    },
}

Variants§

§

Input

Error due to invalid input values.

This variant is returned when initial validation of the function’s arguments fails according to the defined validation policy (e.g., StrictFinitePolicy) or due to domain-specific constraints (e.g., negative input to a real logarithm).

Fields

§source: SqrtComplexInputErrors<RawComplex>

The source error that occurred during input validation. This provides specific details about why the input was considered invalid.

§

Output

Error due to the computed output failing validation.

This variant is returned if the result of the computation, even from valid inputs, fails validation according to the defined policy. This typically means the result was non-finite (NaN or Infinity) or otherwise did not meet the criteria for a valid output.

Fields

§source: <RawComplex as RawScalarTrait>::ValidationErrors

The source error that occurred during output validation. This provides specific details about why the computed output was considered invalid.