#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

#657 in Rust patterns

Download history 10/week @ 2024-01-04 25/week @ 2024-01-11 24/week @ 2024-01-18 103/week @ 2024-01-25 31/week @ 2024-02-01 43/week @ 2024-02-08 96/week @ 2024-02-15 169/week @ 2024-02-22 112/week @ 2024-02-29 98/week @ 2024-03-07 137/week @ 2024-03-14 149/week @ 2024-03-21 225/week @ 2024-03-28 231/week @ 2024-04-04 353/week @ 2024-04-11 110/week @ 2024-04-18

937 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