File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -89,15 +89,17 @@ Use `is_prime` to test whether a given number is prime:
89
89
const CHECK : bool = is_prime (18_446_744_073_709_551_557 );
90
90
assert! (CHECK );
91
91
```
92
- Find the next or previous prime numbers with ` next_prime ` and ` previous_prime ` if they exist:
92
+ Find the next or previous prime numbers with ` next_prime ` and ` previous_prime ` if they exist and can be represented in a ` u64 ` :
93
93
``` rust
94
94
const NEXT : Option <u64 > = next_prime (25 );
95
95
const PREV : Option <u64 > = previous_prime (25 );
96
- const NOSUCH : Option <u64 > = previous_prime (2 );
96
+ const NO_SUCH : Option <u64 > = previous_prime (2 );
97
+ const TOO_BIG : Option <u64 > = next_prime (u64 :: MAX );
97
98
98
99
assert_eq! (NEXT , Some (29 ));
99
100
assert_eq! (PREV , Some (23 ));
100
- assert_eq! (NOSUCH , None );
101
+ assert_eq! (NO_SUCH , None );
102
+ assert_eq! (TOO_BIG , None );
101
103
```
102
104
and more!
103
105
You can’t perform that action at this time.
0 commit comments