Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -5,10 +5,7 @@ function divmod(int a, int b) returns [int, int] {
}
function pow(int n, int e) returns int {
if e < 1 { return 1; }
int prod = 1;
foreach int i in 1...e { prod *= n; }
return prod;
return <int> (<float> n).pow(<float> e);
}
public function main() returns error? {
@ -17,8 +14,8 @@ public function main() returns error? {
io:println("sum: ", a + b);
io:println("difference: ", a - b);
io:println("product: ", a * b);
io:println("integer quotient: ", a / b); // rounds towards zero
io:println("remainder: ", a % b); // sign matches sign of first operand
io:println("integer quotient: ", a / b);
io:println("remainder: ", a % b);
io:println("exponentiation: ", pow(a, b));
io:println("divmod ", divmod(a, b));
io:println("divmod: ", divmod(a, b));
}