Skip to content

operations.aug ​

Checked-error benchmark · Source and specification

Files in this project

Code ​

aug
// aug-spec: "operations.aug.md" explains this file. Read it before changes; refresh with aug spec.
validate(int value) returns int unless FileError:
    if value - value / 16 * 16 == 0:
        throw FileError()
    return value
aug
// aug-spec: "operations.aug.md" explains this file. Read it before changes; refresh with aug spec.
validate(int value) returns int unless FileError {
    if value - value / 16 * 16 == 0 {
        throw FileError()
    }
    return value
}

Compiled specification ​

Interactions and sequences

validate · source ​

It takes value as an integer. Failures can raise FileError.

It checks that (value minus ((value divided by 16) times 16)) does not equal 0. It raises a FileError at the first failed check. It returns value. source

Checked interface
text
validate(int value) returns int unless FileError

It takes value as an integer. Failures can raise FileError.

Last updated:

The world runs on language