## Texas Instruments TI-89 and TI-92 Plus Computer

Last page update: March 07, 2000
 Number Base - for the TI-89 and TI-92 Plus Version nBase(): 2.0   (March 07, 2000) b2d(): 1.0   (September 22, 1999) d2b(): 2.0   (March 07, 2000) Download [ nbase.zip ] 13,050 bytes (contains d2b(), b2d(), nBase(), and this document) Reference CRC Standard Mathematical Tables and Formula, 30th Edition, Paragraph 1.1.2, 1.2.4, 1.2.7. Description nBase(): Converts floating point numbers between bases.  b2d(): Converts floating point numbers of any base to decimal. d2b(): Converts floating point decimal numbers to any base. March 07, 2000 - Modified nBase() and d2b() to return list of character values when base>36. Screen shots Documentation Usage: nBase(NumberStr | {NumberStr}, CurrentBase, NewBase | {NewBase, Precision})  b2d(NumberStr, CurrentBase)  d2b(NumberStr | {NumberStr}, NewBase | {NewBase, Precision})  NumberStr: Alphanumeric STR representing a number to any base. if NumberStr is entered in braces, {}, a list of character values will be returned. CurrentBase: The number base of NumberStr.  NewBase: The number base that NumberStr should be converted to.  Precision: Optional precision. Changes the limit of the number of  fractional positions from the default of 12. The default can be permanently changed by editing the line "12->pre" in the program code to the desired value.  NOTE: These functions will accept bases greater than 36 but only 35 characters are available. This is permitted so that numbers of greater bases can be converted. If a character of value 3510 or greater is needed, a list of character values is returned instead. NOTE: These functions will accept numbers (var type NUM) in NumberStr so that the user can more easily enter numbers of base 10 or less. Ex: nBase(10,2,1020)="2 [1020]" instead of nBase("10",2,1020)="2 [1020]" Return value: If any character in NumberStr is illegal in CurrentBase, undef is returned. nBase(): If NumberStr is a STR, a STR is returned. if NumberStr is a NUM and NewBase=10, a NUM is returned. If NumberStr is enclosed in braces, {}, a list of character values is returned.  d2b(): A STR is returned.  b2d(): Normally a NUM is returned. If NumberStr is enclosed in braces, {}, a list of character values is returned. Examples: 1. nBase(10.101,2,10)   or   b2d(10.101,2)       2.625  2. nBase(ln(5),10,8)   or   d2b(ln(5),8)       "1.470020373755 [8]"  3. nBase("FF.01",16,2)   or   d2b(b2d("FF.01",16),2)       "11111111.00000001 [2]"  4. nBase("FF.01",16,{2,1})   or   d2b(b2d("FF.01",16),{2,1})       "11111111.0 [2]" 1.  5. nBase({10.101},2,{11,2})   or   d2b({c},{11,2})|c=b2d(10.101,2)      {2, ".", 6, 9}