Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIntXL (work in progress) #119

Merged
merged 188 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
5388082
NBKFlexibleWidthKit (#33).
oscbyspro Jul 11, 2023
b272e3d
Merge.
oscbyspro Jul 14, 2023
707796b
NBKFlexibleWidthKit: Cleanup.
oscbyspro Jul 14, 2023
3596ef1
NBKFlexibleWidthKit: Storage.
oscbyspro Jul 15, 2023
74132d1
NBKFlexibleWidthKit: Normalization.
oscbyspro Jul 15, 2023
c9fd451
NBKFlexibleWidthKit: Text.
oscbyspro Jul 16, 2023
d2dfa84
Merge.
oscbyspro Jul 16, 2023
178cfd3
NBKFlexibleWidthKit: Cleanup.
oscbyspro Jul 16, 2023
39c24ff
NBKFlexibleWidthKit: Cleanup.
oscbyspro Jul 16, 2023
4bfaa4c
NBKFlexibleWidthKit: Addition, Subtraction.
oscbyspro Jul 16, 2023
65882ac
NBKFlexibleWidthKit: Cleanup.
oscbyspro Jul 16, 2023
6b7c411
NBKFlexibleWidthKit: Addition, Subtraction.
oscbyspro Jul 17, 2023
b5b6ba0
NBKFlexibleWidthKit: Multiplication.
oscbyspro Jul 17, 2023
8cbb086
NBKFlexibleWidthKit: Multiplication.
oscbyspro Jul 17, 2023
5947bf4
NBKFlexibleWidthKit: Cleanup.
oscbyspro Jul 17, 2023
8d43c1a
NBKFlexibleWidthKit: Logic.
oscbyspro Jul 18, 2023
c19d220
NBKFlexibleWidthKit: Shifts.
oscbyspro Jul 18, 2023
dfc7b23
Merge.
oscbyspro Jul 19, 2023
5a1b310
Cleanup.
oscbyspro Jul 20, 2023
a219956
Merge.
oscbyspro Jul 20, 2023
7212c26
Merge.
oscbyspro Jul 24, 2023
abd2f0e
NBKFlexibleWidthKit: Division.
oscbyspro Jul 24, 2023
e13ebf0
NBKFlexibleWidthKit: Storage.
oscbyspro Jul 24, 2023
f912321
NBKFlexibleWidthKit: Division.
oscbyspro Jul 24, 2023
2fc4b16
NBKFlexibleWidthKit: Cleanup.
oscbyspro Jul 25, 2023
a03cbb8
NBKFlexibleWidthKit: Tests.
oscbyspro Jul 25, 2023
aaf9a72
Merge.
oscbyspro Jul 26, 2023
8abfd31
NBKFlexibleWidthKit: IntXL, TODOs.
oscbyspro Jul 26, 2023
f9e01c3
Merge.
oscbyspro Jul 28, 2023
9d1ff06
NBKFlexibleWidthKit: Sign.
oscbyspro Jul 28, 2023
c15221f
NBKFlexibleWidthKit: IntXL.
oscbyspro Jul 29, 2023
a3878de
NBKFlexibleWidthKit: IntXL.
oscbyspro Jul 29, 2023
a1ffe87
NBKFlexibleWidthKit: Cleanup.
oscbyspro Jul 30, 2023
37ea019
NBKFlexibleWidthKit: Digit.
oscbyspro Jul 30, 2023
db66a0e
NBKFlexibleWidthKit: Cleanup.
oscbyspro Jul 30, 2023
1eea96b
Merge.
oscbyspro Jul 30, 2023
2a0f157
Merge.
oscbyspro Jul 30, 2023
d075eaa
NBKFlexibleWidthKit: Addition, Subtraction.
oscbyspro Jul 30, 2023
ca720ff
NBKFlexibleWidthKit: Multiplication.
oscbyspro Jul 30, 2023
c20b88c
NBKFlexibleWidthKit: Cleanup.
oscbyspro Jul 30, 2023
84abc87
NBKFlexibleWidthKit: Division.
oscbyspro Jul 31, 2023
cc7bb4e
NBKFlexibleWidthKit: Text.
oscbyspro Jul 31, 2023
c8234d5
Merge.
oscbyspro Jul 31, 2023
2548845
NBKFlexibleWidthKit: Shifts.
oscbyspro Aug 1, 2023
5e327ff
NBKFlexibleWidthKit: Numbers.
oscbyspro Aug 1, 2023
e4cd13f
Merge.
oscbyspro Aug 3, 2023
a2c5626
NBKFlexibleWidth: Bits.
oscbyspro Aug 3, 2023
2faa889
Merge.
oscbyspro Aug 3, 2023
f8d6bc7
NBKFlexibleWidthKit: Bits, Cleanup.
oscbyspro Aug 3, 2023
c5941c4
Merge.
oscbyspro Aug 3, 2023
db6f970
Merge.
oscbyspro Aug 4, 2023
8628ee5
NBKFlexibleWidth: Cleanup.
oscbyspro Aug 4, 2023
91c8e50
NBKResizableWidthKit.
oscbyspro Aug 4, 2023
53ee3a6
NBKResizableWidthKit: Miscellaneous.
oscbyspro Aug 4, 2023
e519160
NBKResizableWidthKit: Miscellaneous.
oscbyspro Aug 4, 2023
75a9f0e
NBKFlexibleWidthKit: NBKResizableWidthKit.
oscbyspro Aug 5, 2023
77245f2
Merge.
oscbyspro Aug 5, 2023
7cf5ee9
NBKFlexibleWidthKit: Cleanup.
oscbyspro Aug 5, 2023
be6c79e
Merge.
oscbyspro Aug 5, 2023
b94c7fd
NBKResizableWidthKit: Xcode.
oscbyspro Aug 5, 2023
e9054ba
NBKFlexibleWidthKit: Tests & Benchmarks.
oscbyspro Aug 6, 2023
c48a084
Merge.
oscbyspro Aug 6, 2023
c6cef2f
NBKResizableWidthKit: TODOs.
oscbyspro Aug 6, 2023
c98e72d
NBKResizableWidthKit: Words.
oscbyspro Aug 6, 2023
233e9f2
NBKResizableWidthKit: Bits.
oscbyspro Aug 6, 2023
c5f3371
Merge.
oscbyspro Aug 6, 2023
f73c2e0
NBKResizableWidthKit: Comparisons.
oscbyspro Aug 6, 2023
ac349fc
NBKResizableWidthKit: Logic.
oscbyspro Aug 7, 2023
84579fa
NBKResizableWidthKit: Shifts.
oscbyspro Aug 7, 2023
e0a0de5
Merge.
oscbyspro Aug 7, 2023
8e56e53
Merge.
oscbyspro Aug 7, 2023
941dae2
Merge.
oscbyspro Aug 7, 2023
5902b73
Update.
oscbyspro Aug 7, 2023
520f3a6
Merge.
oscbyspro Aug 8, 2023
6d49e69
Merge.
oscbyspro Aug 8, 2023
73aff00
Merge.
oscbyspro Aug 9, 2023
76902f1
NBKResizableWidthKit: Addition.
oscbyspro Aug 9, 2023
4979953
NBKResizableWidthKit: Subtraction.
oscbyspro Aug 9, 2023
38f0aaa
NBKResizableWidthKit: Subtraction.
oscbyspro Aug 9, 2023
c65165e
NBKResizableWidthKit: Division.
oscbyspro Aug 9, 2023
21907d7
Merge.
oscbyspro Aug 9, 2023
ef23ebb
NBKResizableWidthKit: Cleanup.
oscbyspro Aug 10, 2023
b0640b6
Merge.
oscbyspro Aug 10, 2023
830a856
NBKResizableWidthKit: Addition, Subtraction.
oscbyspro Aug 11, 2023
dcceac4
NBKResizableWidthKit: Addition, Subtraction.
oscbyspro Aug 11, 2023
70b6fc6
Merge.
oscbyspro Aug 11, 2023
eb89acf
Merge.
oscbyspro Aug 11, 2023
e99c487
[NBKFlexibleWidthKit] Merge up to and including v0.11.0 (#33).
oscbyspro Sep 9, 2023
371b7df
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Sep 11, 2023
7740703
[NBKFlexibleWidthKit] Dropped NBKResizableWidthKit (#33) (#46).
oscbyspro Sep 11, 2023
39468ce
[NBKFlexibleWidthKit] Dropped NBKResizableWidth.
oscbyspro Sep 11, 2023
20c9b0f
Start of 2's complement rework (#44).
oscbyspro Sep 12, 2023
8abe19c
[2's rework] Day 2 (#44).
oscbyspro Sep 13, 2023
4e0143b
[2's rework] Merge.
oscbyspro Sep 13, 2023
5bcf825
[2's rework] Day 3 (#44).
oscbyspro Sep 14, 2023
6747413
[2's rework] Merge.
oscbyspro Sep 14, 2023
d0756c2
[2's rework] Day 3 (#44).
oscbyspro Sep 14, 2023
be5be3a
No flexible in-memory 2's complement (#44).
oscbyspro Sep 14, 2023
0063ebb
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Sep 15, 2023
c54255d
Start of sign and magnitude (#81).
oscbyspro Sep 15, 2023
1115e42
[NBKSignedKit] NBKSigned (#81).
oscbyspro Sep 15, 2023
759f2e5
[NBKSignedKit] Tests (#81).
oscbyspro Sep 15, 2023
f23fb2d
[NBKSignedKit] Tests n' stuff.
oscbyspro Sep 15, 2023
39a96aa
[NBKSignedKit] Benchmarks.
oscbyspro Sep 15, 2023
fbe135f
[NBKFlexibleWidthKit] Dropped IntXL (#33) (#81).
oscbyspro Sep 16, 2023
a79b3f2
Miscellaneous.
oscbyspro Sep 16, 2023
eb48436
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Sep 16, 2023
a4e01a0
[NBKFlexibleWidthKit] Strict unsigned integer (#83).
oscbyspro Sep 17, 2023
f1e0562
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Sep 17, 2023
96eee06
[NBKFlexibleWidthKit] Shifts. Stuff.
oscbyspro Sep 17, 2023
54546b7
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Sep 18, 2023
7bbf72c
[NBKFlexibleWidthKit] Strict bit pattern (#83).
oscbyspro Sep 18, 2023
8f4a9f3
[NBKFlexibleWidthKit] Merge 5535417.
oscbyspro Sep 20, 2023
102e934
[NBKFlexibleWidthKit] Merge 006780e.
oscbyspro Sep 23, 2023
f67003a
[NBKFlexibleWidthKit] Merge through 7b6cf53.
oscbyspro Sep 28, 2023
c5df811
[NBKSignedKit] Documentation.
oscbyspro Sep 28, 2023
8311bd2
[NBKFlexibleWidthKit] Merge through 906622f.
oscbyspro Sep 28, 2023
05f601a
[NBKSignedKit] ExpressibleByStringLiteral (#86).
oscbyspro Sep 28, 2023
560f8c0
[NBKFlexibleWidthKit] Merge through 0ef2f33.
oscbyspro Sep 29, 2023
cd41fcf
[NBKSignedKit] StaticBigInt.
oscbyspro Sep 29, 2023
48beebb
[NBKFlexibleWidthKit] Merge through f5049ca.
oscbyspro Oct 2, 2023
edf1425
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Oct 2, 2023
c9b76e4
[NBKSignedKit] Cleanup and StaticBigInt fix™
oscbyspro Oct 2, 2023
4f7129b
[NBKFlexibleWidthKit] Merge through abab042.
oscbyspro Oct 3, 2023
df86d30
[NBKSigned] StaticBigInt (#97).
oscbyspro Oct 3, 2023
91df233
[NBKSigned] Cleanup.
oscbyspro Oct 3, 2023
8264de2
[NBKSignedKit] Req. `init?(words:isSigned:)` (#89).
oscbyspro Oct 4, 2023
954f580
[NBKSignedKit] Words (#81).
oscbyspro Oct 4, 2023
734f957
[NBKSignedKit] Cleanup. Normalization.
oscbyspro Oct 4, 2023
25ef511
[NBKSignedKit] Safer sign stuff.
oscbyspro Oct 4, 2023
a069137
[NBKSignedKit] Cleanup. Comparisons. Components.
oscbyspro Oct 4, 2023
c316e9d
[NBKSignedKit] Zzz.
oscbyspro Oct 4, 2023
2dd43b1
[NBKSignedKit] Merge through edd6607.
oscbyspro Oct 4, 2023
7136557
Merge through 1081daa.
oscbyspro Oct 5, 2023
df12ae6
[NBKFlexibleWidthKit] Merge through 73dd4dc.
oscbyspro Oct 15, 2023
5de7680
[NBKSignedKit] Numbers. Some tests from open source issues.
oscbyspro Oct 16, 2023
c212607
[FlexibleWidthKit] Division.
oscbyspro Oct 17, 2023
a671bde
[NBKFlexibleWidthKit] Division.
oscbyspro Oct 18, 2023
aaff59d
[NBKFlexibleWidthKit] Merge through 294446d.
oscbyspro Oct 19, 2023
16f4058
[NBKFlexibleWidthKit] Merge through 9a67372.
oscbyspro Oct 19, 2023
1a04cee
[NBKFlexibleWidthKit] Merge through 9c8087f.
oscbyspro Oct 21, 2023
b1eb6ba
[NBKFlexibleWidthKit] Long multiplication algorithm.
oscbyspro Oct 21, 2023
e062037
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Oct 22, 2023
2b02ab1
[NBKFlexibleWidthKit] Words. Uninitialized.
oscbyspro Oct 22, 2023
d717cf2
[NBKFlexibleWidthKit] Merge through 4c2677c.
oscbyspro Oct 22, 2023
58873b0
[NBKFlexibleWidthKit] Cleanup. Comments.
oscbyspro Oct 22, 2023
417832a
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Oct 23, 2023
40ab09e
[NBKFlexibleWidthKit] Merge through 5f459ca.
oscbyspro Oct 23, 2023
c878c35
[NBKFlexibleWidthKit] No NBKSignedKit (#33).
oscbyspro Oct 23, 2023
ed2e165
[NBKFlexibleWidthKit] In-place update methods.
oscbyspro Oct 23, 2023
0629aca
[NBKFlexibleWidthKit] Exponentiation.
oscbyspro Oct 24, 2023
ba79947
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Oct 24, 2023
50dcd02
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Oct 25, 2023
7426b65
[NBKFlexibleWidthKit] Long square product.
oscbyspro Oct 25, 2023
7287989
[NBKFlexibleWidthKit] Improved long square product.
oscbyspro Oct 26, 2023
15b5e6d
[NBKFlexibleWidthKit] Merge through 39261b1.
oscbyspro Oct 26, 2023
991c144
Merge through 56acf68.
oscbyspro Nov 3, 2023
c5e8155
[NBKFlexibleWidthKit] Fibonacci sequence pair at index.
oscbyspro Nov 3, 2023
e1b2058
[NBKFlexibleWidthKit] FibonacciXL.
oscbyspro Nov 4, 2023
447c513
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Nov 4, 2023
9748152
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Nov 4, 2023
dc6967f
[NBKFlexibleWidthKit] Merge through f4d63f8.
oscbyspro Nov 4, 2023
1c3770d
Big integer Karatsuba algorithm (#108).
oscbyspro Nov 5, 2023
7c45651
Galaxy brain stuff and Karatsuba squares (20+ words) (#108).
oscbyspro Nov 6, 2023
8e5fba8
`floor(_:)` good, `ceil(_:)` bad, on floor can sleep (#108).
oscbyspro Nov 6, 2023
c49f1af
Cleanup of Karatsuba algorithms (#108).
oscbyspro Nov 7, 2023
316f3ca
Karatsuba cleanup and larger Fibonacci tests (#108).
oscbyspro Nov 7, 2023
88bb4ae
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Nov 7, 2023
b8015e0
[NBKFlexibleWidthKit] Merge through dd62d0e.
oscbyspro Nov 7, 2023
efc6ded
[NBKFlexibleWidthKit] Merge through 9cf7860.
oscbyspro Nov 8, 2023
a1a33e1
Fibonacci sequence element at index by double and add composition (#1…
oscbyspro Nov 8, 2023
4854ae0
[NBKFlexibleWidthKit] Fibonacci.
oscbyspro Nov 8, 2023
fe4f8a1
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Nov 9, 2023
a585e3e
[NBKFlexibleWidthKit] Merge through 9d1d4a4.
oscbyspro Nov 12, 2023
a4cabbb
[NBKFlexibleWidthKit] No `#if DEBUG` unit testing (#112).
oscbyspro Nov 12, 2023
6072ac7
[NBKFlexibleWidthKit] README. Large integer division tests using Fibo…
oscbyspro Nov 12, 2023
a2ece6b
[NBKFlexibleWidthKit] NBKFibonacciXL as CustomStringConvertible.
oscbyspro Nov 12, 2023
88e0ecb
[NBKFlexibleWidthKit] Cleanup.
oscbyspro Nov 17, 2023
a2fdb81
[NBKFlexibleWidthKit] Merge through 4d8f6b8.
oscbyspro Nov 17, 2023
cb04136
[NBKFlexibleWidthKit] More encoding tests. MOAR!
oscbyspro Nov 17, 2023
d463979
[NBKFlexibleWidthKit] More encoding tests. MOAR!
oscbyspro Nov 17, 2023
0eafe04
[NBKFlexibleWidthKit] More text tests. MOAR!
oscbyspro Nov 18, 2023
b5e23fc
[Tests] Cleanup of aliases.
oscbyspro Nov 19, 2023
98170bb
[NBKFlexibleWidthKit] Merge through 727d944.
oscbyspro Nov 19, 2023
ec3da38
Cleanup.
oscbyspro Dec 10, 2023
2fa476d
[NBKFlexibleWidthKit] Merge through ec3da38.
oscbyspro Dec 10, 2023
da5b5f6
[NBKFlexibleWidthKit] Prepare for merge into main branch.
oscbyspro Dec 10, 2023
b4884ed
Cleanup (#119).
oscbyspro Dec 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .swiftpm/NBKFlexibleWidthKit-Benchmarks.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"configurations" : [
{
"id" : "2BBD9A51-D890-4B97-AED4-B9962867DF57",
"name" : "Main",
"options" : {

}
}
],
"defaultOptions" : {
"codeCoverage" : false
},
"testTargets" : [
{
"skippedTests" : [
"NBKFibonacciXLBenchmarks\/testNoLoop10000000()",
"NBKFlexibleWidthBenchmarksOnExponentiationAsUIntXL\/test7RaisedToPrime777()",
"NBKFlexibleWidthBenchmarksOnExponentiationAsUIntXL\/testNoLoop5RaisedToPrime22222()",
"NBKFlexibleWidthBenchmarksOnExponentiationAsUIntXL\/testNoLoop5RaisedToPrime33333()",
"NBKFlexibleWidthBenchmarksOnExponentiationAsUIntXL\/testNoLoop5RaisedToPrime55555()",
"NBKFlexibleWidthBenchmarksOnExponentiationAsUIntXL\/testNoLoop7RaisedToPrime77777()",
"NBKFlexibleWidthBenchmarksOnTextAsUIntXL\/testEncodingUsingSwiftStdlibRadix10()",
"NBKFlexibleWidthBenchmarksOnTextAsUIntXL\/testEncodingUsingSwiftStdlibRadix16()"
],
"target" : {
"containerPath" : "container:",
"identifier" : "NBKFlexibleWidthKitBenchmarks",
"name" : "NBKFlexibleWidthKitBenchmarks"
}
}
],
"version" : 1
}
32 changes: 32 additions & 0 deletions .swiftpm/NBKFlexibleWidthKit.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"configurations" : [
{
"id" : "6FC9897F-2BF3-4836-8372-787CE5195F87",
"name" : "Main",
"options" : {

}
}
],
"defaultOptions" : {
"codeCoverage" : {
"targets" : [
{
"containerPath" : "container:",
"identifier" : "NBKFlexibleWidthKit",
"name" : "NBKFlexibleWidthKit"
}
]
}
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:",
"identifier" : "NBKFlexibleWidthKitTests",
"name" : "NBKFlexibleWidthKitTests"
}
}
],
"version" : 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NBKFlexibleWidthKit"
BuildableName = "NBKFlexibleWidthKit"
BlueprintName = "NBKFlexibleWidthKit"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:.swiftpm/NBKFlexibleWidthKit.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:.swiftpm/NBKFlexibleWidthKit-Benchmarks.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = "Time Profiler"
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NBKFlexibleWidthKit"
BuildableName = "NBKFlexibleWidthKit"
BlueprintName = "NBKFlexibleWidthKit"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
71 changes: 71 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/NBKFlexibleWidthKit.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NBKFlexibleWidthKit"
BuildableName = "NBKFlexibleWidthKit"
BlueprintName = "NBKFlexibleWidthKit"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:.swiftpm/NBKFlexibleWidthKit.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NBKFlexibleWidthKit"
BuildableName = "NBKFlexibleWidthKit"
BlueprintName = "NBKFlexibleWidthKit"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
20 changes: 20 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ let package = Package(
.library(
name: "NBKDoubleWidthKit",
targets: ["NBKDoubleWidthKit"]),
//=--------------------------------------=
// NBK x Flexible Width Kit
//=--------------------------------------=
.library(
name: "NBKFlexibleWidthKit",
targets: ["NBKFlexibleWidthKit"]),
],
targets: [
//=--------------------------------------=
Expand Down Expand Up @@ -84,6 +90,20 @@ let package = Package(
.testTarget(
name: "NBKDoubleWidthKitTests",
dependencies: ["NBKDoubleWidthKit"]),
//=--------------------------------------=
// NBK x Flexible Width Kit
//=--------------------------------------=
.target(
name: "NBKFlexibleWidthKit",
dependencies: ["NBKCoreKit"]),

.testTarget(
name: "NBKFlexibleWidthKitBenchmarks",
dependencies: ["NBKFlexibleWidthKit"]),

.testTarget(
name: "NBKFlexibleWidthKitTests",
dependencies: ["NBKFlexibleWidthKit"]),
]
)

Expand Down
50 changes: 47 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

* [NBKCoreKit](#nbkcorekit)
* [NBKDoubleWidthKit](#nbkdoublewidthkit)
* [NBKFlexibleWidthKit](#nbkflexiblewidthkit)
* [Installation](#installation)
* [Acknowledgements](#acknowledgements)

Expand Down Expand Up @@ -113,6 +114,43 @@ Int256(5) % Int(5), UInt256(5) % UInt(5)
> [!NOTE]
> You can use `StaticString` until `StaticBigInt` becomes available.

<a name="nbkflexiblewidthkit"/>

## [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

```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
```

<a name="installation"/>

## Installation
Expand All @@ -138,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 All @@ -163,15 +202,20 @@ This project is inspired by [**Int128**][Apple/Int128] and [**DoubleWidth**][App

[NBK/D]: https://oscbyspro.github.io/Numberick/documentation/numberick
[DBL/D]: https://oscbyspro.github.io/Numberick/documentation/numberick/nbkdoublewidth
[FLX/D]: https://oscbyspro.github.io/Numberick/documentation/numberick/nbkflexiblewidth
[SIG/D]: https://oscbyspro.github.io/Numberick/documentation/numberick/nbksigned

[COR/S]: Sources/NBKCoreKit
[DBL/S]: Sources/NBKDoubleWidthKit
[FLX/S]: Sources/NBKFlexibleWidthKit

[COR/T]: Tests/NBKCoreKitTests
[DBL/T]: Tests/NBKDoubleWidthKitTests
[FLX/T]: Tests/NBKFlexibleWidthKitTests

[COR/B]: Tests/NBKCoreKitBenchmarks
[DBL/B]: Tests/NBKDoubleWidthKitBenchmarks
[FLX/B]: Tests/NBKFlexibleWidthKitBenchmarks

<!-- Links x Miscellaneous -->

Expand Down
4 changes: 2 additions & 2 deletions Sources/NBKCoreKit/Models/NBKPrimeSieve.swift
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ extension NBKPrimeSieve {
/// 5) [6A, 6B, 2A, 6D, 6E, 2B] // 6B, 6E
/// 6) [6A, 6B, 6C, 6D, 6E, 6F] // 6C, 6F
///
/// The idea is to reuse words and subsequences whenever possible.
/// The idea is to reuse elements and subsequences whenever possible.
///
/// - Important: The sieve culls even numbers by omission, so start with `[3,5]`.
///
Expand All @@ -736,7 +736,7 @@ extension NBKPrimeSieve {
patternIndex.remainder &+= current.prime
}; chunk.formOnesComplement()
//=--------------------------=
// pattern: reuse words
// pattern: reuse elements
//=--------------------------=
var ((destination)) = patternIndex.quotient
while destination < current.product {
Expand Down
Loading