Site Tools


tobase

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tobase [2006/07/11 04:57] (current)
Line 1: Line 1:
 +# $EPIC: tobase.txt,​v 1.1.1.1 2006/07/11 04:57:43 jnelson Exp $
 +======Synopsis:​======
 +$__tobase__(<​base>​ <​number>​)
 +
 +======Technical:​======
 +   * <​base>​ is a number from 2 to 36.
 +   * <​number>​ is a base 10 number.
 +   * If <​base>​ or <​number>​ are omitted, the empty string is returned.
 +   * If <​base>​ is not from 2 to 36, the empty string is returned.
 +   * If <​number>​ is not a number, 0 is returned.
 +   * Otherwise, the return value is <​number>​ converted to base <​base>​.
 +   * Remember that <​number>​ has to fit into a (long) variable type.
 +
 +======Practical:​======
 +This is useful to convert a decimal number to  binary, octal, or hex.
 +
 +======Returns:​======
 +The <​number>​ of base 10 converted to the given <​base>​.
 +The empty string if argument is omitted.
 +0 if the conversion was unsucessful.
 +
 +======Examples:​======
 +$strtol(16 180099407) returns ABC194F.
 +
 +======History:​======
 +This function first appeared in EPIC5-0.0.2.
 +
  
tobase.txt ยท Last modified: 2006/07/11 04:57 (external edit)