#odd #integer #even #numeric

is-odd

Returns true if the given number is odd

3 stable releases

Uses old Rust 2015

1.1.0 Nov 11, 2023
1.0.1 Oct 25, 2023
1.0.0 May 26, 2018

#664 in Rust patterns

Download history 11/week @ 2023-12-24 1/week @ 2023-12-31 21/week @ 2024-01-07 28/week @ 2024-01-14 36/week @ 2024-01-21 79/week @ 2024-01-28 50/week @ 2024-02-04 57/week @ 2024-02-11 127/week @ 2024-02-18 166/week @ 2024-02-25 104/week @ 2024-03-03 66/week @ 2024-03-10 185/week @ 2024-03-17 140/week @ 2024-03-24 276/week @ 2024-03-31 154/week @ 2024-04-07

761 downloads per month
Used in 5 crates (3 directly)

MIT license

3KB

is-odd

Returns true if the given number is odd.

Install

Specify the dependencty in Cargo.toml:

[dependencies]
is-odd = "~1.1.0"

Fetch it with cargo:

$ cargo build

Usage

extern crate is_odd;
use is_odd::IsOdd;

let _i : i32 = 1;
println!("{}", _i.is_odd()); // prints true

Known tradeoffs

Currently, the library doesn't support floating point numbers.

About

License

Copyright © 2018, nukeop. Released under the MIT License.

No runtime deps