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

chore: use nim version 2.2.2 #85

Merged
merged 3 commits into from
Feb 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/nim_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- macos-latest
- windows-latest
nim-version:
- '2.0.8'
- '2.2.2'

steps:
- uses: actions/checkout@v4
Expand Down
14 changes: 7 additions & 7 deletions maths/modular_inverse.nim
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ when isMainModule:
check modularInverse(tc.a, tc.modulus).get() == tc.inv

test "No inverse when modulus is 1":
check modularInverse(0, 1).is_none()
check modularInverse(1, 1).is_none()
check modularInverse(-1, 1).is_none()
check modularInverse(0, 1).isNone()
check modularInverse(1, 1).isNone()
check modularInverse(-1, 1).isNone()

test "No inverse when inputs are not co-prime":
check modularInverse(2, 4).is_none()
check modularInverse(-5, 25).is_none()
check modularInverse(0, 17).is_none()
check modularInverse(17, 17).is_none()
check modularInverse(2, 4).isNone()
check modularInverse(-5, 25).isNone()
check modularInverse(0, 17).isNone()
check modularInverse(17, 17).isNone()

randomize()
const randomTestSize = 10
Expand Down