Skip to content

Commit

Permalink
chore: use nim version 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 committed Feb 15, 2025
1 parent f1ce188 commit 9af047b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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.2.0'
- '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

0 comments on commit 9af047b

Please sign in to comment.