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

WiP.ExponentiationOperator History

Hide minor edits - Show changes to output

2015-09-22 13:02 by trijezdci -
Added lines 1-14:
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.

>>background-color:#f4f4f4 padding:0.5em border:'thin solid gray' whitespace:pre<<
'''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.