Skip to content

Commit

Permalink
Cleanup (#114).
Browse files Browse the repository at this point in the history
I changed to trapping arithmetic since I removed the precondition in the previous commit.
  • Loading branch information
oscbyspro committed Dec 4, 2023
1 parent 611af7b commit 02f6df7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/NBKCoreKit/Models/NBKPrimeSieve.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ extension NBKPrimeSieve {
@inline(never) @inlinable public func increment() {
Swift.assert((self.cache.base).allSatisfy({ $0.onesComplement().isZero }))
//=--------------------------------------=
let start = self.limit &+ 0000000000000002
let limit = self.limit &+ self.cache.count * 2 as UInt // traps max sieve (!)
let start = self.limit + 0000000000000002
let limit = self.limit + self.cache.count * 2 as UInt // traps max sieve (!)
var inner = NBK.CyclicIterator(self.wheel.increments)!
//=--------------------------------------=
// mark composites not hit by the wheel
Expand Down

0 comments on commit 02f6df7

Please sign in to comment.