Close
Close window
graycode - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

combinat

graycode

list of the n-bit numbers in graycode order

Calling Sequence

graycode(n)

Parameters

n

-

non-negative integer

Description

The procedure graycode computes and returns a list containing all 2nn-bit integers in a graycode order starting at zero.

A graycode order is such that each successive pair of integers differ in only one bit in their binary representations.

The command with(combinat,graycode) allows the use of the abbreviated form of this command.

Examples

>

withcombinat,graycode

graycode

(1)
>

graycode0

0

(2)
>

graycode1

0,1

(3)
>

ggraycode3

g0,1,3,2,6,7,5,4

(4)
>

printfcat`$`` %.3d`,8,opmapconvert,g,binary

000 001 011 010 110 111 101 100

See Also


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /