bin2gray: Convert from binary to gray code integer

View source: R/bin2gray.R

bin2grayR Documentation

Convert from binary to gray code integer

Description

The function bin2gray converts a binary coded number to gray coded integer.

Usage

bin2gray(bin)

Arguments

bin

A binary coded number.

Details

The bin2gray function works as a compliment of the gray2bin function.

Value

Returns the gray coded integer equivalent of the input number.

Author(s)

Zeynel Cebeci & Erkut Tekeli

See Also

gray2bin

Examples

  bin = c(1,0,1,1)
  bin2gray(bin)     # returns 1110
  
  bin = c(1,0,1,0)
  bin2gray(bin)     # returns 1111

adana documentation built on March 18, 2022, 6:03 p.m.

Related to bin2gray in adana...