ctod (2) --- convert string to double precision real 01/07/83 _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n long_real function ctod (str, i) character str (ARB) integer i Library: vswtlb (standard Subsystem library) _F_u_n_c_t_i_o_n 'Ctod' converts the character string in the array 'str', starting at position 'i', to double precision floating point representation and returns this value as the result of the function. The variable 'i' is incremented to a point one character beyond the string that was converted; the array 'str' is not modified. 'Str' must be an EOS-terminated unpacked character string. 'Ctod' recognizes any valid Fortran constant; in particular, leading signs are handled. Leading blanks and tabs are ignored. _I_m_p_l_e_m_e_n_t_a_t_i_o_n 'Ctod' accumulates the integer and fractional parts of the number, throwing away leading zeros and insignificant digits and computing scaling factors if necessary. A straightfor- ward Horner's method conversion translates each portion of the constant to binary, and finally all portions are com- bined and appropriately scaled. Scaling is aided by using tables of powers-of-two exponents, to preserve as much accuracy as possible. _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d i _C_a_l_l_s gctoi _S_e_e _A_l_s_o dtoc (2), ctor (2), rtoc (2), other conversion routines ('cto?*' and '?*toc') (2) ctod (2) - 1 - ctod (2)