Program Digits;
{$nomain}

{ 
  Version
  File:[22,310]Digits.PAS
  Author: Jim Bostwick  18-Oct-83

  Last Edit: 23-JUN-1988 22:14:24 

  History:
	 23-JUN-1988 21:56:32  - JMB PA3UTL upgrade.


}
{$Nolist}
{[a+,b+,l-,k+,r+] Pasmat }
 %INCLUDE 'PAS$EXT:General.typ';

{$List }

{----------- Compute digits for given radix ------------------------}

Function Digits(w:Word; 
  		radix:integer):Integer;
  		External;

{*USER*
 Function returns the number of digits in the input word, assuming
the input radix. UNSIGNED input only!
}

Function Digits;

VAR
  n:integer;

BEGIN
  n := 0;
  while w > 0 do 
    BEGIN 
    n := n + 1;
    w := w div radix
    END;
  Digits := n
END;    

