Skip to content

Commit

Permalink
fix: revert c7e78f5
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Nov 14, 2024
1 parent 0be10d8 commit 44d3aec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- X1OD: `IBinaryInteger<T>.Factorial` now starts at `IBinaryInteger<T>.MultiplicativeIdentity` not
`IBinaryInteger<T>.One`.
- X10D: Removed `IEnumerable<T>.GreatestCommonFactor` for all integer types in favour of generic math.
- X10D: Removed `IEnumerable<T>.LowestCommonMultiple` for all integer types in favour of generic math.
- X10D: Removed `IEnumerable<T>.Product` for all integer types in favour of generic math.
Expand Down
6 changes: 3 additions & 3 deletions X10D/src/Math/BinaryIntegerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ public static long Factorial<TInteger>(this TInteger value)
return 1;
}

TInteger result = TInteger.MultiplicativeIdentity;
long result = 1L;
for (TInteger i = TInteger.One; i <= value; i++)
{
result *= i;
result *= long.CreateChecked(i);
}

return long.CreateChecked(result);
return result;
}
}

0 comments on commit 44d3aec

Please sign in to comment.