factor 0.4.0

Find the factors for any integer.
Documentation
  • Coverage
  • 20%
    1 out of 5 items documented0 out of 2 items with examples
  • Size
  • Source code size: 36.29 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.06 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • Chris-C99/factor
    0 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • RogueWorm

Factor

Find the factors for any integer.

Usage

Cargo.toml

[dependencies]
factor = "0.4"

Add this to your crate root -

extern crate factor;

use factor::factor::factor;
use factor::factor_include::factor_include;

factor() - Will return factors of a given integer EXCLUDING 1 and the given number.

factor_include() - Will return factors of a given integer INCLUDING 1 and the given number.

***Note : Factors are returned in a vector.

#Examples::

-println!("{:?}", factor(144));
    -Prints [2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 36, 48, 72]
-println!("{:?}", factor_include(144));
    -Prints [1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 36, 48, 72, 144]