big: Add factorial, have tests use hex strings.

This commit is contained in:
Jeroen van Rijn
2021-08-11 20:59:52 +02:00
parent db0196abc7
commit e80ac18324
7 changed files with 201 additions and 135 deletions
+2 -2
View File
@@ -240,6 +240,7 @@ int_atoi :: proc(res: ^Int, input: string, radix: i8) -> (err: Error) {
/*
Make sure the radix is ok.
*/
if radix < 2 || radix > 64 {
return .Invalid_Argument;
}
@@ -278,7 +279,7 @@ int_atoi :: proc(res: ^Int, input: string, radix: i8) -> (err: Error) {
ch = rune(input[0]);
if radix <= 36 && ch >= 'a' && ch <= 'z' {
ch += 'a' - 'A';
ch -= 32; // 'a' - 'A'
}
pos := ch - '+';
@@ -299,7 +300,6 @@ int_atoi :: proc(res: ^Int, input: string, radix: i8) -> (err: Error) {
input = input[1:];
}
/*
If an illegal character was found, fail.
*/