home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0210 - 0219 / ibm0210-0219 / ibm0213.tar / ibm0213 / HAM_W32.ZIP / SAMPLES / BITS.CSH < prev    next >
Encoding:
Text File  |  1994-05-12  |  238 b   |  11 lines

  1. #    Calculate the number of bits required to represent a numeric value as
  2. #    an integer.
  3.  
  4. #    Copyright (c) 1989, 1990 by Hamilton Laboratories.  All rights reserved.
  5.         
  6. proc bits ( n )
  7. return ceil ( log2 ( n + 1 ) )
  8. end
  9.  
  10. bits $argv
  11.