mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 04:38:16 +00:00
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:
@@ -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