Skip to content

Commit 7cdef3c

Browse files
committed
Update documentation
1 parent 2cf9084 commit 7cdef3c

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ assert_eq!(5, 12345_i32.wrapping_neg().count_digits_radix(10));
4343
> Negative numbers counted in base-10 are counted differently than
4444
> negative numbers counted in other number bases.
4545

46-
Since negative, base-10 numbers are represented with a negative sign,
47-
the digit count of a positive, base-10 number will be equal to the count
48-
of its negated value.
46+
Since negative numbers represented in base-10 are displayed with a negative sign,
47+
the base-10 digit count of a positive number will be equal to the base-10 digit count
48+
of the number's negated value.
4949

5050
```rust
5151
assert_eq!(
@@ -55,7 +55,7 @@ assert_eq!(
5555
````
5656

5757
However, the digit counts of negative numbers represented in other bases reflect the
58-
[twos-complement representation](https://en.wikipedia.org/wiki/Two%27s_complement),
58+
[twos-complement](https://en.wikipedia.org/wiki/Two%27s_complement) representation,
5959
and the digit count of a positive number will _not_ be the same as the count
6060
of its negated value.
6161

@@ -87,7 +87,7 @@ for radix in 2..=16 {
8787
}
8888
````
8989

90-
These counts are consistent with the representations of Rust's display format.
90+
This behavior is consistent with Rust's display format.
9191
```rust
9292
assert_eq!(1, format!("{:b}", 1_i8).chars().count());
9393
assert_eq!(1, format!("{:o}", 1_i8).chars().count());

src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
//! negative numbers counted in other number bases.
5252
//! </div>
5353
//!
54-
//! Since negative, base-10 numbers are represented with a negative sign,
55-
//! the digit count of a positive, base-10 number will be equal to the count
56-
//! of its negated value.
54+
//! Since negative numbers represented in base-10 are displayed with a negative sign,
55+
//! the base-10 digit count of a positive number will be equal to the base-10 digit count
56+
//! of the number's negated value.
5757
//!
5858
//! ```rust
5959
//! # use count_digits::CountDigits;
@@ -64,7 +64,7 @@
6464
//! ````
6565
//!
6666
//! However, the digit counts of negative numbers represented in other bases reflect the
67-
//! [twos-complement representation](https://en.wikipedia.org/wiki/Two%27s_complement),
67+
//! [twos-complement](https://en.wikipedia.org/wiki/Two%27s_complement) representation,
6868
//! and the digit count of a positive number will _not_ be the same as the count
6969
//! of its negated value.
7070
//!
@@ -97,7 +97,7 @@
9797
//! }
9898
//! ````
9999
//!
100-
//! These counts are consistent with the representations of Rust's display format.
100+
//! This behavior is consistent with Rust's display format.
101101
//! ```rust
102102
//! # use count_digits::CountDigits;
103103
//! assert_eq!(1, format!("{:b}", 1_i8).chars().count());
@@ -119,7 +119,7 @@ use core::num::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZ
119119
pub trait CountDigits: Copy + Sized {
120120
/// The type of integer that should be passed in to the
121121
/// [count_digits_radix()](CountDigits::count_digits_radix) function.
122-
///
122+
///
123123
/// This is equal to [Self](CountDigits) for primitive types,
124124
/// and is equal to the corresponding primitive type for non-zero types.
125125
type Radix;

0 commit comments

Comments
 (0)