Turn core:math/bìg tests into regular core:testing tests.
`core:math/big` has been verified against Python's big integer implementation long enough. Turn it into a regular regression test using the `core:testing` framework, testing against a generated corpus of test vectors.
This commit is contained in:
1 parent
2a292b588a
commit
9dafd77bc0
10 files changed
+10462
-1163
No files matched your search
@@ -1660,13 +1660,13 @@ internal_int_sqrt :: proc(dest, src: ^Int, allocator := context.allocator) -> (e
|
||||
|
||||
if internal_gte(y, x) {
|
||||
internal_swap(dest, x)
|
||||
return nil
|
||||
return internal_clamp(dest)
|
||||
}
|
||||
internal_swap(x, y)
|
||||
}
|
||||
|
||||
internal_swap(dest, x)
|
||||
return err
|
||||
return internal_clamp(dest)
|
||||
}
|
||||
internal_sqrt :: proc { internal_int_sqrt, }
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ int_atoi :: proc(res: ^Int, input: string, radix := i8(10), allocator := context
|
||||
res.sign = sign
|
||||
}
|
||||
|
||||
return nil
|
||||
return internal_clamp(res)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user