pub enum Prealgebra {
    FactorPairs {
        n: u32,
        raw: bool,
    },
    Factors {
        n: u32,
        raw: bool,
    },
    MultiplesInRange {
        n: u32,
        lower_bound: u32,
        upper_bound: u32,
        raw: bool,
    },
    PrimesInRange {
        lower_bound: u32,
        upper_bound: u32,
        raw: bool,
    },
    PrimeFactorization {
        n: u32,
        raw: bool,
    },
    IsComposite {
        n: u32,
        raw: bool,
    },
    IsPrime {
        n: u32,
        raw: bool,
    },
    IsFactor {
        n: u32,
        m: u32,
        raw: bool,
    },
    IsMultiple {
        n: u32,
        m: u32,
        raw: bool,
    },
}

Variants§

§

FactorPairs

Fields

§n: u32

The positive integer to find factor pairs for.

§raw: bool

Whether or not to return the raw output.

Finds all factor pairs for a positive integer.

Example
Input
lz prealgebra factor-pairs 12
Output
The factor pairs of 12 are {(1, 12), (2, 6), (3, 4)}.
Raw Output (use -r or --raw)
{(1, 12), (2, 6), (3, 4)}
§

Factors

Fields

§n: u32

The positive integer to find factors for.

§raw: bool

Whether or not to return the raw output.

Finds all factors for a positive integer.

Example
Input
lz prealgebra factors 12
Output
The factors of 12 are {1, 2, 3, 4, 6, 12}.
Raw Output (use -r or --raw)
{1, 2, 3, 4, 6, 12}
§

MultiplesInRange

Fields

§n: u32

The positive integer to find multiples for.

§lower_bound: u32

The lower bound of the range to find multiples in.

§upper_bound: u32

The upper bound of the range to find multiples in.

§raw: bool

Whether or not to return the raw output.

Finds all multiples of a positive integer in a given range.

Example
Input
lz prealgebra multiples-in-range 3 10
Output
The multiples of 3 in the range [1, 10] are {3, 6, 9}.
Raw Output (use -r or --raw)
{3, 6, 9}
§

PrimesInRange

Fields

§lower_bound: u32

The lower bound of the range to find primes in.

§upper_bound: u32

The upper bound of the range to find primes in.

§raw: bool

Whether or not to return the raw output.

Finds all primes in a given range.

Example
Input
lz prealgebra primes-in-range 1 10
Output
The primes in the range [1, 10] are {2, 3, 7, 5}.
Raw Output (use -r or --raw)
{2, 3, 7, 5}
§

PrimeFactorization

Fields

§n: u32

The positive integer to find the prime factorization of.

§raw: bool

Whether or not to return the raw output.

Finds the prime factorization of a positive integer.

Example
Input
lz prealgebra prime-factorization 12
Output
The prime factorization of 12 is {3: 1, 2: 2}.
Raw Output (use -r or --raw)
{3: 1, 2: 2}
§

IsComposite

Fields

§n: u32

The positive integer to determine if it is composite.

§raw: bool

Whether or not to return the raw output.

Determines if a positive integer is composite.

Example
Input
lz prealgebra is-composite 12
Output
12 is composite.
Raw Output (use -r or --raw)
true
§

IsPrime

Fields

§n: u32

The positive integer to determine if it is prime.

§raw: bool

Whether or not to return the raw output.

Determines if a positive integer is prime.

Example
Input
lz prealgebra is-prime 12
Output
12 is not prime.
Raw Output (use -r or --raw)
false
§

IsFactor

Fields

§n: u32

The positive integer to determine if it is a factor.

§m: u32

The positive integer to determine if it is a multiple.

§raw: bool

Whether or not to return the raw output.

Determines if a positive integer is a factor of another positive integer.

Example
Input
lz prealgebra is-factor 3 12
Output
3 is a factor of 12.
Raw Output (use -r or --raw)
true
§

IsMultiple

Fields

§n: u32

The positive integer to determine if it is a multiple.

§m: u32

The positive integer to determine if it is a factor.

§raw: bool

Whether or not to return the raw output.

Determines if a positive integer is a multiple of another positive integer.

Example
Input
lz prealgebra is-multiple 12 3
Output
12 is a multiple of 3.
Raw Output (use -r or --raw)
true

Trait Implementations§

source§

impl FromArgMatches for Prealgebra

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Subcommand for Prealgebra

source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.