factorialfunction 0.1.1

factorialfunction takes an input of u32 and returns its factorial.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 15.44 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • shawais786/factorialfunction
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • shawais786

factorialfunction

Function named factorial() takes input of positive integer and shows its factorial If a positive integer is not entered, the function will keep on taking an input until a positive integer is entered. To reduce the size, u32 variables are used hence you can enter from 0 ~ 12 to get factorial. Function will return the factorial of the value entered by you.

To use this library you have to add following line in [dependencies] section of Cargo.toml factorialfunction = "0.1.0"

Your cargo.toml file should look like this:

.
.
.
edition = "2018"

[dependencies]
factorialfunction = "0.1.0"

In src/main.rs you can use like this:

use factorialfunction;
fn main() {
    println!("Hello, world!");
    factorialfunction::factorial();
}

Following will also work:

use factorialfunction::factorial;
fn main() {
    println!("Hello, world!");
    factorial();
}

now cargo run for results