bedec |
Table of contents
ProcedureBEDEC ( Be a decimal number? ) LOGICAL FUNCTION BEDEC ( STRING ) AbstractDetermine whether a string represents a decimal number. Required_ReadingNone. KeywordsALPHANUMERIC NUMBERS SCANNING UTILITY DeclarationsIMPLICIT NONE CHARACTER*(*) STRING Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- STRING I Character string. The function returns .TRUE. if the string represents a decimal number. Otherwise, it returns .FALSE. Detailed_InputSTRING is any string. Detailed_OutputIf the input string contains a decimal number (as defined in $Particulars below), the function returns .TRUE. Otherwise, the functions returns .FALSE. ParametersNone. ExceptionsError free. FilesNone. ParticularsA decimal number may be constructed by concatenating the following components in the order shown. 1) A sign ('+' or '-'), or the null string. 2) An unsigned integer (as defined by function BEUNS), or the null string. 3) A decimal point, or the null string. 4) An unsigned integer, or the null string. ExamplesFour classes of numbers recognized by the various BE functions. UNS unsigned integer INT integer (includes INT) DEC decimal number (includes UNS, INT) NUM number (includes UNS, INT, NUM) The following table illustrates the differences between the classes. (Any number of leading and trailing blanks are acceptable.) String Accepted by ------------------ ------------------ 0 UNS, INT, DEC, NUM 21 21994217453648 +0 INT, DEC, NUM -13 +21946 1.23 DEC, NUM 12. .17 +4.1 -.25 2.3e17 NUM 17.D-13275849 -.194265E+0004 Note that the functions don't take the magnitudes of the numbers into account. They may accept numbers that cannot be represented in Fortran variables. (For example, '2.19E999999999999' probably exceeds the maximum floating point number on any machine, but is perfectly acceptable to BENUM.) The following strings are not accepted by any of the functions. String Reason --------------- ---------------------------------------- 3/4 No implied operations (rational numbers) 37+14 No explicit operations E12 Must have mantissa 217,346.91 No commas 3.14 159 264 No embedded spaces PI No special numbers FIVE No textual numbers CXIV No roman numerals RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) W.L. Taber (JPL) VersionSPICELIB Version 1.1.0, 24-NOV-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. SPICELIB Version 1.0.0, 01-DEC-1995 (WLT) |
Fri Dec 31 18:35:59 2021