#odd #integer #even #numeric

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

#537 in Rust patterns

Download history 139/week @ 2024-09-16 175/week @ 2024-09-23 154/week @ 2024-09-30 103/week @ 2024-10-07 180/week @ 2024-10-14 125/week @ 2024-10-21 235/week @ 2024-10-28 114/week @ 2024-11-04 23/week @ 2024-11-11 58/week @ 2024-11-18 143/week @ 2024-11-25 84/week @ 2024-12-02 382/week @ 2024-12-09 155/week @ 2024-12-16 173/week @ 2024-12-23 113/week @ 2024-12-30

825 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