#odd #integer #numeric #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

#486 in Rust patterns

Download history 235/week @ 2024-12-18 38/week @ 2024-12-25 118/week @ 2025-01-01 233/week @ 2025-01-08 322/week @ 2025-01-15 262/week @ 2025-01-22 419/week @ 2025-01-29 219/week @ 2025-02-05 207/week @ 2025-02-12 181/week @ 2025-02-19 242/week @ 2025-02-26 271/week @ 2025-03-05 133/week @ 2025-03-12 112/week @ 2025-03-19 164/week @ 2025-03-26 216/week @ 2025-04-02

644 downloads per month
Used in 5 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