builtin functions for division and remainder division

* add `@divTrunc` and `@divFloor` functions
 * add `@rem` and `@mod` functions
 * add compile error for `/` and `%` with signed integers
 * add `.bit_count` for float primitive types

closes #217
This commit is contained in:
Andrew Kelley
2017-05-06 23:13:12 -04:00
parent 866c841dd8
commit 157af4332a
21 changed files with 976 additions and 315 deletions

View File

@@ -23,6 +23,8 @@ const char *err_str(int err) {
case ErrorOverflow: return "overflow";
case ErrorPathAlreadyExists: return "path already exists";
case ErrorUnexpected: return "unexpected error";
case ErrorExactDivRemainder: return "exact division had a remainder";
case ErrorNegativeDenominator: return "negative denominator";
}
return "(invalid error)";
}