bigint: itoa now writes backwards directly, no need to reverse after.

This commit is contained in:
Jeroen van Rijn
2021-08-11 20:59:50 +02:00
parent 04a83eb9f7
commit d7ae611f76
2 changed files with 40 additions and 27 deletions
+8 -2
View File
@@ -58,12 +58,18 @@ demo :: proc() {
fmt.printf("b: %s, err: %v\n\n", bs, err);
delete(bs);
c, err = init();
c, err = init(-4);
defer destroy(c);
cs, err = itoa(c);
fmt.printf("b: %s, err: %v\n\n", cs, err);
fmt.printf("c: %s, err: %v\n\n", cs, err);
delete(cs);
cstr: cstring;
defer delete(cstr);
cstr, err = itoa_cstring(a);
fmt.printf("cstring: %v, err: %v\n\n", cstr, err);
fmt.println("=== Add ===");
err = sub(c, a, b);