#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

#1197 in Rust patterns

Download history 174/week @ 2024-07-12 479/week @ 2024-07-19 471/week @ 2024-07-26 144/week @ 2024-08-02 677/week @ 2024-08-09 228/week @ 2024-08-16 172/week @ 2024-08-23 181/week @ 2024-08-30 182/week @ 2024-09-06 145/week @ 2024-09-13 183/week @ 2024-09-20 165/week @ 2024-09-27 114/week @ 2024-10-04 144/week @ 2024-10-11 161/week @ 2024-10-18 162/week @ 2024-10-25

612 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