<<prev file | next file >>    view single page | view frames    summary: fields | routine    details: routine

ToBeReviewed/LECTURE/

inverse_binary.pro

Inverse function of the binary function => given a input array of 0/1, return its corresponding byte/integer/long representation

topinverse_binary

result = inverse_binary(binnumb)

Return value

A byte/integer/long array with (d1, d2...) dimensions

Parameters

binnumb        in required

Must be a binary type array containing only 0 and 1. According to binary outputs, binnum array must have the following dimensions values: (8, t, d1, d2...) t gives the output type: t = 1 -> byte t = 2 -> integer t = 4 -> long (d1, d2...) are the output dimensions

Examples

IDL> a=indgen(5) IDL> b=binary(a) IDL> help, b B BYTE = Array[8, 2, 5] IDL> print, b 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 IDL> help, inverse_binary(b) INT = Array[5] IDL> print, inverse_binary(b) 0 1 2 3 4

Version history

Version

$Id: inverse_binary.pro 371 2008-08-07 09:32:02Z pinsard $

History

Sebastien Masson (smasson@jamstec.go.jp) July 2004

Known issues

Restrictions

The binary number can represent only byte/integer/long

Statistics

McCabe cyclic 9
McCabe essential 1
McCabe modular design 1
Produced by IDLdoc 2.0.