home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / hcshdemo.zip / csh-os2.zip / SAMPLES / BITS.CSH < prev    next >
Text File  |  1993-09-28  |  238b  |  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.