Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Exponentiation Operator

We may introduce an exponentiation operator in a future revision as follows:

The Exponentiation Operator

Symbol ** denotes the exponentiation operator. It is right associative and requires two operands.

Example:

 r := base ** exponent; (* exponentiation *)

The operator always represents the exponentiation operation. Its operands must be of a scalar type and they must be type compatible. Its result type is the operand type. Any use of the operator with operands that do not meet these conditions shall cause a compile time error. The exponentiation operator is bindable.

The operator would likely have precedence level-4.