Skip to content

Commit

Permalink
[NBKFlexibleWidthKit] Prepare for merge into main branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
oscbyspro committed Dec 10, 2023
1 parent 2fa476d commit da5b5f6
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 58 deletions.
15 changes: 0 additions & 15 deletions .swiftpm/Numberick-Benchmarks.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,6 @@
"identifier" : "NBKDoubleWidthKitBenchmarks",
"name" : "NBKDoubleWidthKitBenchmarks"
}
},
{
"skippedTests" : [
"NBKFibonacciXLBenchmarks\/testNoLoop10000000()",
"NBKFlexibleWidthBenchmarksOnExponentiationAsUIntXL\/test7RaisedToPrime777()",
"NBKFlexibleWidthBenchmarksOnExponentiationAsUIntXL\/testNoLoop5RaisedToPrime22222()",
"NBKFlexibleWidthBenchmarksOnExponentiationAsUIntXL\/testNoLoop5RaisedToPrime33333()",
"NBKFlexibleWidthBenchmarksOnExponentiationAsUIntXL\/testNoLoop5RaisedToPrime55555()",
"NBKFlexibleWidthBenchmarksOnExponentiationAsUIntXL\/testNoLoop7RaisedToPrime77777()"
],
"target" : {
"containerPath" : "container:",
"identifier" : "NBKFlexibleWidthKitBenchmarks",
"name" : "NBKFlexibleWidthKitBenchmarks"
}
}
],
"version" : 1
Expand Down
12 changes: 0 additions & 12 deletions .swiftpm/Numberick.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
"containerPath" : "container:",
"identifier" : "NBKDoubleWidthKit",
"name" : "NBKDoubleWidthKit"
},
{
"containerPath" : "container:",
"identifier" : "NBKFlexibleWidthKit",
"name" : "NBKFlexibleWidthKit"
}
]
}
Expand All @@ -43,13 +38,6 @@
"identifier" : "NBKDoubleWidthKitTests",
"name" : "NBKDoubleWidthKitTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "NBKFlexibleWidthKitTests",
"name" : "NBKFlexibleWidthKitTests"
}
}
],
"version" : 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@
<TestPlanReference
reference = "container:.swiftpm/NBKDoubleWidthKit-Benchmarks.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:.swiftpm/NBKFlexibleWidthKit.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:.swiftpm/NBKFlexibleWidthKit-Benchmarks.xctestplan">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
Expand Down
17 changes: 0 additions & 17 deletions .swiftpm/xcode/xcshareddata/xcschemes/Numberick.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,6 @@
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NBKFlexibleWidthKit"
BuildableName = "NBKFlexibleWidthKit"
BlueprintName = "NBKFlexibleWidthKit"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
Expand Down Expand Up @@ -90,9 +76,6 @@
<TestPlanReference
reference = "container:.swiftpm/NBKDoubleWidthKit.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:.swiftpm/NBKFlexibleWidthKit.xctestplan">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let package = Package(
//=--------------------------------------=
.target(
name: "Numberick",
dependencies: ["NBKCoreKit", "NBKDoubleWidthKit", "NBKFlexibleWidthKit"]),
dependencies: ["NBKCoreKit", "NBKDoubleWidthKit"]),
//=--------------------------------------=
// NBK x Core Kit
//=--------------------------------------=
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ Int256(5) % Int(5), UInt256(5) % UInt(5)

## [NBKFlexibleWidthKit][FLX/D] ([Sources][FLX/S], [Tests][FLX/T], [Benchmarks][FLX/B])

👨‍💻🛠️🚧🧱🧱🏗️🧱🧱🚧⏳
> [!IMPORTANT]
> It's a work in progress. I may rework it at any time.
### Models

- [NBKFibonacciXL](Sources/NBKFlexibleWidthKit/Models/NBKFibonacciXL.swift)
- [UIntXL](Sources/NBKFlexibleWidthKit/Models/NBKFlexibleWidth.swift)

### Fibonacci

This sequence is instrumental for testing big integers, and it's fun.

```swift
NBKFibonacciXL(0) // (index: 0, element: 0, next: 1)
NBKFibonacciXL(1) // (index: 1, element: 1, next: 1)
Expand All @@ -141,6 +141,7 @@ It uses a fast double-and-add algorithm:

```swift
NBKFibonacciXL(10_000_000) // 2.3s on M1 MacBook Pro
```

But you can also step through it manually:

Expand Down Expand Up @@ -175,9 +176,10 @@ Add this package to your list of package dependencies.
Choose target dependencies from the products in [Package.swift](Package.swift).

```swift
.product(name: "Numberick", package: "Numberick"),
.product(name: "NBKCoreKit", package: "Numberick"),
.product(name: "NBKDoubleWidthKit", package: "Numberick"),
.product(name: "Numberick", package: "Numberick"),
.product(name: "NBKCoreKit", package: "Numberick"),
.product(name: "NBKDoubleWidthKit", package: "Numberick"),
.product(name: "NBKFlexibleWidthKit", package: "Numberick"),
```

### Using [CocoaPods](http://cocoapods.org)
Expand Down
35 changes: 35 additions & 0 deletions Sources/Numberick/Documentation.docc/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,41 @@ Int256(5) % Int(5), UInt256(5) % UInt(5)

- Note: You can use `StaticString` until `StaticBigInt` becomes available.

> [!IMPORTANT]
> It's a work in progress. I may rework it at any time.
## NBKFlexibleWidthKit

### Models

- ``NBKFibonacciXL``
- ``UIntXL``

### Fibonacci

```swift
NBKFibonacciXL(0) // (index: 0, element: 0, next: 1)
NBKFibonacciXL(1) // (index: 1, element: 1, next: 1)
NBKFibonacciXL(2) // (index: 2, element: 1, next: 2)
NBKFibonacciXL(3) // (index: 3, element: 2, next: 3)
NBKFibonacciXL(4) // (index: 4, element: 3, next: 5)
NBKFibonacciXL(5) // (index: 5, element: 5, next: 8)
```

It uses a fast double-and-add algorithm:

```swift
NBKFibonacciXL(10_000_000) // 2.3s on M1 MacBook Pro
```

But you can also step through it manually:

```swift
public mutating func increment() { ... } // index + 1
public mutating func decrement() { ... } // index - 1
public mutating func double() { ... } // index * 2
```

## Topics

### Protocols
Expand Down
1 change: 0 additions & 1 deletion Sources/Numberick/Numberick.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@

@_exported import NBKCoreKit
@_exported import NBKDoubleWidthKit
@_exported import NBKFlexibleWidthKit

0 comments on commit da5b5f6

Please sign in to comment.