#integer #numeric #odd #even

is-odd

Returns true if the given number is odd

4 stable releases

1.1.1 Dec 23, 2024
1.1.0 Nov 11, 2023
1.0.1 Oct 25, 2023
1.0.0 May 26, 2018

#1746 in Rust patterns

Download history 56/week @ 2025-10-15 70/week @ 2025-10-22 27/week @ 2025-10-29 27/week @ 2025-11-05 32/week @ 2025-11-12 51/week @ 2025-11-19 37/week @ 2025-11-26 26/week @ 2025-12-03 10/week @ 2025-12-10 37/week @ 2025-12-17 29/week @ 2025-12-24 24/week @ 2025-12-31 2/week @ 2026-01-07 25/week @ 2026-01-14 45/week @ 2026-01-21 25/week @ 2026-01-28

101 downloads per month
Used in 11 crates (3 directly)

MIT license

4KB

is-odd

Returns true if the given number is odd.

Install

Specify the dependencty in Cargo.toml:

[dependencies]
is-odd = "1.1.1"

Or:

$ cargo add is_odd

Fetch it with cargo:

$ cargo build

Usage

use is_odd::IsOdd;

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

About

Currently, the library support both integer and floating point numbers.

License

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

No runtime deps