Skip to content

Commit 6bbec93

Browse files
ArrogantGaoXuanzhaoGao
and
XuanzhaoGao
authored
fix the function _ssub (#59)
* fix ssub * more tests * fix ci --------- Co-authored-by: XuanzhaoGao <[email protected]>
1 parent 6c59011 commit 6bbec93

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

.github/workflows/CI.yml

+5-14
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,15 @@ jobs:
2222
arch:
2323
- x64
2424
steps:
25-
- uses: actions/checkout@v2
26-
- uses: julia-actions/setup-julia@v1
25+
- uses: actions/checkout@v4
26+
- uses: julia-actions/setup-julia@v2
2727
with:
2828
version: ${{ matrix.version }}
2929
arch: ${{ matrix.arch }}
30-
- uses: actions/cache@v1
31-
env:
32-
cache-name: cache-artifacts
33-
with:
34-
path: ~/.julia/artifacts
35-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
36-
restore-keys: |
37-
${{ runner.os }}-test-${{ env.cache-name }}-
38-
${{ runner.os }}-test-
39-
${{ runner.os }}-
30+
- uses: julia-actions/cache@v2
4031
- uses: julia-actions/julia-buildpkg@v1
4132
- uses: julia-actions/julia-runtest@v1
4233
- uses: julia-actions/julia-processcoverage@v1
43-
- uses: codecov/codecov-action@v1
34+
- uses: codecov/codecov-action@v5
4435
with:
45-
file: lcov.info
36+
files: lcov.info

src/longlonguint.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ end
117117
function _ssub(x::NTuple{C,UInt}, y::NTuple{C,UInt}, c::Bool) where {C}
118118
v1, c1 = Base.sub_with_overflow(x[C], y[C])
119119
if c
120-
v2, c2 = Base.sub_with_overflow(v1, c)
120+
v2, c2 = Base.sub_with_overflow(v1, one(UInt))
121121
c = c1 || c2
122122
return (_ssub(x[1:C-1], y[1:C-1], c)..., v2)
123123
else

test/longlonguint.jl

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ using Test, BitBasis
3535
BitBasis.max_num_elements(LongLongUInt{2}, 4) == 40
3636
BitBasis.max_num_elements(UInt, 2) == 64
3737
BitBasis.max_num_elements(Int, 2) == 63
38+
39+
@test count_ones(bmask(LongLongUInt{50}, 1:3000)) == 3000
3840
end
3941

4042
@testset "shift" begin

0 commit comments

Comments
 (0)