# $EPIC: isnumber.txt,v 1.2 2006/08/01 03:40:36 sthalik Exp $ ======Synopsis:====== $__isnumber__() \\ $__isnumber__(b ) \\ $__isnumber__( b) ======Technical:====== * The argument may either be the first or second word, but in either case must be prefixed with the literal 'b' character. * The argument may either be the first or second word, but in either case must NOT be prefixed with the literal 'b' character. * If the argument is not specified, the default value is 0. * If is 0, the number base is auto-detected. * is taken to be a string containing an integer value, a decimal point ('.' -- sorry), and another integer value; comprised of digits which are legal in the indicated base. * If a decimal point is used and the is 0, then the integer value after the decimal point must be in base 10 and will not be auto-detected. * The return value is 1 if is a valid number in the indicated base, and 0 if is not a valid number in the indicated base. ======Practical:====== Wow. That's complicated. This function (believe it or not) just tells you whether or not is a number. You can specify a number base (such as b8, or b16) to see if is a number in a base other than base 10. This is neccesary if you want to octal or hexidecmial numbers for validity. ======Returns:====== 1 if is a valid number of base ; 0 if not. ======Examples:====== $isnumber(10) returns 1 $isnumber(hello) returns 0 $isnumber(0xdeadbeef) returns 1 (all hex digits!) $isnumber(b8 0xdeadbeef) returns 0 (not an octal number!) $isnumber(b8 07f932) returns 0 (9 is not an octal digit!) $isnumber(3.4) returns 1 $isnumber(b16 a.f) returns 1 $isnumber(a.f) returns 0 (hex digits invalid without 0x) $isnumber(0xa.0) returns 1 $isnumber(b16 a.f) returns 1 (hex digits valid with b16)