Skip to content

Commit

Permalink
Add example for sieve_segment!
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard authored May 7, 2024
1 parent 4107842 commit df79a4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ assert_eq!(PRIME_STATUS_LT, Ok([false, true, false]));
The sieve size can be computed by the crate by using the macros `primes_segment!` and `sieve_segment!`.
```rust
const PRIMES_GEQ: Result<[u64; 2], GenerationError> = primes_segment!(2; >= 615);
const PRIME_STATUS_LT: Result<[bool; 3], SieveError> = sieve_segment!(3; < 100_005);
// 100_102 100_103 100_104
assert_eq!(PRIME_STATUS_LT, Ok([false, true, false]));
assert_eq!(PRIMES_GEQ, Ok([617, 619]));
```

Expand Down

0 comments on commit df79a4d

Please sign in to comment.