Wafl Home

Primitive Data Types Tutorial

Integer Operators

Usual arithmetical operators are supported: addition (+), subtraction (-), multiplication (*), division (/) and unary negation (-). The division of integer values computes an integer result. The integer division remainder operator is available (%).

Bit-level integer operators are syntactically and semantically equivalent to these operators in programming language C: bit-level binary conjunction (&), bit-level binary disjunction (|) and bit-level unary complement (~).

Multiplication, division, remainder and bit-level conjunction have higher priority than addition, subtraction and bit-level disjunction.

Source code:

{#
17 / 10,
17 % 10,
240 & 63,   // '11110000' & '00111111' = '00110000' = 48
3 | 6,      // '011' | '110' = '111' = 7
-5,
~5          // bit-level complement
#}

Result:

{# 1, 7, 48, 7, -5, -6 #}

 

Table of Contents

Let's Start

Program Structure

Primitive Data Types

List

Tuple

Record

HTML

Command Line Interpreter

Using Web Servers

Syntax

Examples

Tips

The most of examples evaluates with both command line and Web server Wafl interpreters. If any example is based on specific features of an interpreter, it is explicitly annotated.