source: trunk/ToBeReviewed/LECTURE/GRIB/bit2int.pro @ 67

Last change on this file since 67 was 67, checked in by pinsard, 18 years ago

miscellaneous modifications according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/

  • Property svn:executable set to *
File size: 299 bytes
Line 
1FUNCTION bit2int, bitin, checkneg = checkneg
2
3  res = 0L
4  n = n_elements(bitin)-1
5  IF keyword_set(checkneg) THEN BEGIN
6    IF bitin[0] EQ 1 THEN BEGIN
7      bitin[0] = 0
8      neg = -1
9    ENDIF ELSE neg = 1
10  ENDIF ELSE neg = 1
11  FOR i = 0, n  DO res = res+2L^i*bitin[n-i]
12
13  RETURN, neg*res
14END
Note: See TracBrowser for help on using the repository browser.