NAME dtoc - convert double precision number to character string SYNOPSIS stat = dtoc (dbl, str, p, w) DESCRIPTION This routine converts a double precision floating point number to a string of characters. 'w' is the maximum length of the output string not including the EOS. 'p' specifies the number of digits to the right of the decimal point on output. If 'p' is negative the output is forced to exponential notation with '|p|' significant digits. If more than 'w' characters are needed, the output string is truncated and rounded to fit, forced to exponential notation, or filled with 'w' asterisks (to indicate overflow), in that order. The function returns the length of the output string on sucessful conversions and "ERR" otherwise. SEE ALSO ctod, ctoi, putdbl DIAGNOSTICS If space required for the output string exceeds given space ('w'), a string of 'w' asterisks is returned. AUTHOR John Chong, Lawrence Berkeley Laboratory BUGS The 15th significant digit may not be correct due to floating point arithmetic inaccuracy. NAME ctod - convert character string to double precision number SYNOPSIS stat = ctod (str, dbl) DESCRIPTION This routine converts a string of digits into a double precision number. 'str' is the input string containing the digits. The input may be of the form (12.34), (12.34E35), or (12.34D35). 'dbl' is the converted numeric output. All leading and trailing blanks are ignored; the first illegal character (i.e., not 0-9, decimal point, E, D, +, or -) seen terminates the scan of string 'str'. The function returns "YES" on sucessful conversions and "ERR" otherwise. The number 'dbl' returned is meaningless on "ERR" conditions and should be ignored. SEE ALSO dtoc, itoc, ctoi DIAGNOSTICS "ERR" is returned if 'str' does not represent a legitimate number (e.g., 67.88.66) or on exponent overflow / underflow. AUTHOR John Chong, Lawrence Berkeley Laboratory BUGS The 15th significant digit may not be correct due to floating point arithmetic inaccuracy. NAME putdbl - write double precision floating point number to file SYNOPSIS call putdbl (d, p, w, fc) DESCRIPTION This routine writes onto the file 'fc' the double precision floating point number 'd' as a string of characters. 'w' is the maximum length of the output string not including the EOS. 'p' specifies the number of digits to the right of the decimal point on output. If 'p' is negative the output is forced to exponential notation with '|p|' significant digits. When fewer than 'w' characters are needed, blanks are inserted to the left to make up the count. However if more than 'w' characters are needed, the output string is truncated and rounded to fit, forced to exponential notation, or filled with 'w' asterisks (to indicate overflow), in that order. 'fc' is the logical unit identifier for the output file (usually returned from a call to OPEN). SEE ALSO dtoc, ctod, putdec DIAGNOSTICS If space required for the output string exceeds given space ('w'), a string of 'w' asterisks is written. AUTHOR John Chong, Lawrence Berkeley Laboratory BUGS The 15th significant digit may not be correct due to floating point arithmetic inaccuracy. NAME rtoc - convert single precision number to character string SYNOPSIS stat = rtoc (real, str, p, w) DESCRIPTION This routine converts a single precision floating point number to a string of characters. 'w' is the maximum length of the output string not including the EOS. 'p' specifies the number of digits to the right of the decimal point on output. If 'p' is negative the output is forced to exponential notation with '|p|' significant digits. If more than 'w' characters are needed, the output string is truncated and rounded to fit, forced to exponential notation, or filled with 'w' asterisks (to indicate overflow), in that order. The function returns the length of the output string on sucessful conversions and "ERR" otherwise. SEE ALSO dtoc, itoc, putreal, putdbl DIAGNOSTICS If space required for the output string exceeds given space ('w'), a string of 'w' asterisks is returned. AUTHOR John Chong, Lawrence Berkeley Laboratory BUGS The 7th significant digit may not be correct due to floating point arithmetic inaccuracy. NAME ctor - convert character string to single precision number SYNOPSIS stat = ctor (str, real) DESCRIPTION This routine converts a string of digits into a single precision number. 'str' is the input string containing the digits. The input may be of the form (12.34), (12.34E35), or (12.34D35). 'real' is the converted numeric output. All leading and trailing blanks are ignored; the first illegal character (i.e., not 0-9, decimal point, E, D, +, or -) seen terminates the scan of string 'str'. The function returns "YES" on sucessful conversions and "ERR" otherwise. The number 'real' returned is meaningless on "ERR" conditions and should be ignored. SEE ALSO ctod, dtoc, ctoi DIAGNOSTICS "ERR" is returned if 'str' does not represent a legitimate number (e.g., 67.88.66) or on an exponent overflow/underflow. AUTHOR John Chong, Lawrence Berkeley Laboratory BUGS The 7th significant digit may not be correct due to floating point arithmetic inaccuracy. NAME putreal - write single precision floating point number to file SYNOPSIS call putreal (r, p, w, fc) DESCRIPTION This routine writes onto the file 'fc' the single precision floating point number 'r' as a string of characters. 'w' is the maximum length of the output string not including the EOS. 'p' specifies the number of digits to the right of the decimal point on output. If 'p' is negative the output is forced to exponential notation with '|p|' significant digits. When fewer than 'w' characters are needed, blanks are inserted to the left to make up the count. However if more than 'w' characters are needed, the output string is truncated and rounded to fit, forced to exponential notation, or filled with 'w' asterisks (to indicate overflow), in that order. 'fc' is the logical unit identifier for the output file (usually returned from a call to OPEN). SEE ALSO dtoc, rtoc, putdec, putdbl DIAGNOSTICS If space required for the output string exceeds given space ('w'), a string of 'w' asterisks is returned. AUTHOR John Chong, Lawrence Berkeley Laboratory BUGS The 7th significant digit may not be correct due to floating point arithmetic inaccuracy.