Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
oscbyspro committed Oct 14, 2024
1 parent 10c1a8c commit 5d7e16d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Sources/CoreKit/BinaryInteger+Factorial.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ extension Namespace {
high = index.down(Shift(unchecked: ilog2))
high = high.decremented().unchecked() | 1

if let stride = Nonzero(exactly: high.minus(low).unchecked().down(Shift.one)) {
let stride = high.minus(low).unchecked().down(Shift.one)
if let stride = Nonzero(exactly: stride) {
let next = products.next (stride)
sequence = sequence.times((next))
(result) = sequence.times(result)
Expand Down
10 changes: 5 additions & 5 deletions Tests/UltimathnumTests/BinaryInteger+Factorial.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct BinaryIntegerTestsOnFactorial {
// MARK: Tests
//=------------------------------------------------------------------------=

@Test("element at small natural index", arguments: [
@Test("BinaryInteger/factorial() - element at small natural index", arguments: [
(index: 0 as U8, element: 1 as IXL),
(index: 1 as U8, element: 1 as IXL),
Expand Down Expand Up @@ -81,7 +81,7 @@ struct BinaryIntegerTestsOnFactorial {

/// - Seealso: https://www.wolframalpha.com/input?i=1000%21
/// - Seealso: https://www.wolframalpha.com/input?i=1024%21
@Test("element at large natural index", arguments: [
@Test("BinaryInteger/factorial() - element at large natural index", arguments: [
(index: IXL(1000), element: IXL("""
0000000000000000000000000000000000000000000000000000000040238726\
Expand Down Expand Up @@ -207,7 +207,7 @@ struct BinaryIntegerTestsOnFactorialEdgeCases {
// MARK: Tests
//=------------------------------------------------------------------------=

@Test("element at negative index is nil [uniform]", arguments: typesAsBinaryIntegerAsSigned, fuzzers)
@Test("BinaryInteger/factorial() - element at negative index is nil [uniform]", arguments: typesAsBinaryIntegerAsSigned, fuzzers)
func elementAtNegativeIndexIsNil(type: any SignedInteger.Type, randomness: consuming FuzzerInt) {
whereIs(type)

Expand All @@ -228,7 +228,7 @@ struct BinaryIntegerTestsOnFactorialEdgeCases {
}

/// Here we check that the infinite even factors overshift the result.
@Test("element at infinite index is zero with error [uniform]", arguments: typesAsArbitraryIntegerAsUnsigned, fuzzers)
@Test("BinaryInteger/factorial() - element at infinite index is zero with error [uniform]", arguments: typesAsArbitraryIntegerAsUnsigned, fuzzers)
func elementAtInfiniteIndexIsZeroWithError(type: any ArbitraryIntegerAsUnsigned.Type, randomness: consuming FuzzerInt) {
whereIs(type)

Expand All @@ -248,7 +248,7 @@ struct BinaryIntegerTestsOnFactorialEdgeCases {
}
}

@Test("element at random index error propagation [entropic]", arguments: typesAsBinaryInteger, fuzzers)
@Test("BinaryInteger/factorial() - element at random index error propagation [entropic]", arguments: typesAsBinaryInteger, fuzzers)
func elementAtRandomIndexErrorPropagation(type: any BinaryInteger.Type, randomness: consuming FuzzerInt) {
whereIs(type)

Expand Down

0 comments on commit 5d7e16d

Please sign in to comment.