Skip to content

main.aug ​

CPU benchmark · Source and specification

Files in this project

Code ​

aug
// aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
// A loop-carried dependency prevents removal of the computation.
int state = 123
int index = 0
while index < 2000000:
    int product = state * 48271
    state = product - product / 2147483647 * 2147483647
    index = index + 1
print(value=state)
aug
// aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
// A loop-carried dependency prevents removal of the computation.
int state = 123
int index = 0
while index < 2000000 {
    int product = state * 48271
    state = product - product / 2147483647 * 2147483647
    index = index + 1
}
print(value=state)

Compiled specification ​

Interactions and sequences

Startup ​

It sets state to 123. It sets index to 0. While index is less than 2000000, it sets product to state times 48271; then it sets state to product minus ((product divided by 2147483647) times 2147483647); then it increases index by 1. After the loop, it prints state. source

Built-in operations follow the language reference.

Last updated:

The world runs on language