From a1afddbf8843d01c93cad0735fce4417318a096e Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Mon, 13 Jul 2020 19:01:37 -0400 Subject: started #for, also fixed some other stuff (including io.puti) --- std/io.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'std/io.toc') diff --git a/std/io.toc b/std/io.toc index 10ec1d3..15314c9 100644 --- a/std/io.toc +++ b/std/io.toc @@ -285,7 +285,7 @@ fwritei ::= fn(use f: &File, x: int) err : FileError { *out = '-'; out += 1; // get the absolute value of x in a u64. this complicated stuff is needed because -INT_MIN doesn't fit in a 64-bit signed integer - x_unsigned = (x as u64) - 18446744073709551615 - 1; + x_unsigned = (18446744073709551615 - (x as u64)) + 1; } else { *out = '0'; out += 1; -- cgit v1.2.3