Numberick
Numberick copied to clipboard
An arithmagick overhaul in Swift
I'm working on a Big[U]Int™ module. That's it. That's the ~~tweet~~ GitHub post.
Given that you only need primes up to the square root of `x` to sieve `x`, there are faster ways of sieving a range than sieving every prime from zero...
I'm working on some prime stuff, and I need a `squareRoot(of:)` method that doesn't rely on floating points. So, I use Newton's method. It's relatively fast and super simple. In...
I think this is a low-priority issue, but still (#58): > The difference appears to be between iOS 15 and iOS 16.4: ``` // Swift 5.8, iPhone 13 Pro, iOS...
I'll need a flexible-width integer protocol, in order for `NBKSigned` to function as a "BigInt" model (#33) (#81). `NBKSigned` is not a binary integer, so it won't conform to it,...
NBKUnsignedInteger already requires recoverable unsigned subtraction (#34): ```swift func subtractingReportingOverflow(_ other: Self) -> PVO mutating func subtractReportingOverflow(_ other: Self) -> Bool @_disfavoredOverload func subtractingReportingOverflow(_ other: Digit) -> PVO @_disfavoredOverload mutating...
The final thing I want to investigate before committing to a flexible-width solution is whether I can efficiently model the signed part as a `Signed` wrapper. I know fixed-width is...
#### Introduction Swift 5.9 ([SE-0377](https://github.com/apple/swift-evolution/blob/main/proposals/0377-parameter-ownership-modifiers.md)) introduces `borrowing` and `consuming` parameter ownership modifiers. #### An immediate use case I'm working on some utility methods with the following `inout` convention: ```swift @inlinable...
I'd like to have a protocol that encompasses Signed\ without shoehorning it down the binary integer protocol hierarchy. I imagine something like a numeric-but-divisible-and-convertible-thing-y. I haven't thought of the requirements...