The Hyper Programming Language

Class ‘nat’

This is the class reference of built-in type nat.

Class

sealed class nat : object

This class represents an unsigned native integer (natural number).

Constructors

procedure new()

Default constructor. Creates a nat with value 0.

procedure new(n : * nat)

Copy constructor.

implicit procedure new(b : byte)

Implicit conversion constructor.

implicit procedure new(n : nat16)

Implicit conversion constructor.

Procedures

const procedure truncateToSigned() : int

Converts the unsigned number to a signed version. The most significant bit is lost.

Operators

Warning: this is preliminary syntax with the purpose of documenting the operators of this class. Nothing official yet!

Unary Operators

const operator+() : nat

Unary plus.

const operator++() : nat

Successor.

const operator--() : nat

Predecessor.

Binary Operators

not yet documented

Increment/decrement operators

operator++()

Increment operator.

operator--()

Decrement operator.

Assignment Operators

operator=(n : nat)

Simple assignment operator.

operator+=(n : nat)

Add-assign operator.

operator-=(n : nat)

Subtract-assign operator.

operator*=(n : nat)

Multiply-assign operator.

operator/=(n : nat)

Divide-assign operator.

operator%=(n : nat)

Modulo-assign operator.

See also


Valid HTML 4.01 Strict Valid CSS!