Enum lz::prealgebra::Prealgebra
source · pub enum Prealgebra {
FactorPairs {
n: u32,
raw: bool,
},
Factors {
n: u32,
raw: bool,
},
MultiplesInRange {
n: 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
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
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
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
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, 5, 7].
Raw Output (use -r or --raw)
[2, 3, 5, 7]
PrimeFactorization
Fields
Finds the prime factorization of a positive integer.
Example
Input
lz prealgebra prime-factorization 12
Output
The prime factorization of 12 is {2: 2, 3: 1}.
Raw Output (use -r or --raw)
{2: 2, 3: 1}
IsComposite
Fields
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
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
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
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
impl FromArgMatches for Prealgebra
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
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>
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
impl Subcommand for Prealgebra
source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
source§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Test whether
Self can parse a specific subcommandAuto Trait Implementations§
impl RefUnwindSafe for Prealgebra
impl Send for Prealgebra
impl Sync for Prealgebra
impl Unpin for Prealgebra
impl UnwindSafe for Prealgebra
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