home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff218.lzh / EdLib / man / StrToD < prev    next >
Text File  |  1989-06-04  |  2KB  |  59 lines

  1. STRTOD(3)                  Library Functions                 STRTOD(3)
  2.  
  3.  
  4.  
  5. NAME
  6.      strtod - convert a string to a double precision floating point
  7.      number
  8.  
  9. SYNOPSIS
  10.      #include <edlib.h>
  11.  
  12.      double strtod(str,ptr)
  13.      char *str;
  14.      char **ptr;
  15.  
  16. DESCRIPTION
  17.      Strtod converts the character string str to a double precision
  18.      floating point number and returns this value.  Strtod recognises
  19.      the following in a string representing a valid double:
  20.  
  21.         <space>... [+|-] <digit>... [. <digit>...] [<exponent>]
  22.  
  23.      where <exponent> is
  24.  
  25.         e|E [+|-| ] <digit> <digit>...
  26.  
  27.      If ptr is not (char**)NULL, *ptr is assigned a pointer to the
  28.      character just after the last character accepted by strtod.
  29.      This will typically be a layout character or NUL.
  30.  
  31.      If there are not any digits at the beginning of the string,
  32.      (e.g. the input is "e45" or "Fred" or "-gotcha-") strtod will
  33.      make *ptr point to the whole of str (even if there were leading
  34.      spaces and signs) and will return 0.0.
  35.  
  36.      If there is some problem with the exponent (e.g. the input is
  37.      "1.2e%45") strtod will reject all of the exponent, making *ptr
  38.      point to the 'e', and will convert only the preceding characters.
  39.  
  40.      A single space after the 'e' or 'E' of an exponent is accepted as
  41.      if it were a '+' sign, because some output formatting routines
  42.      generate numbers in this form.  Spaces are not otherwise accepted
  43.      inside numbers.
  44.  
  45.      If the correct value cannot be represented, strtod sets the
  46.      external variable errno to ERANGE, and returns +/-HUGE for
  47.      overflow, +/-ZERO for underflow.
  48.  
  49. WARNING
  50.      Strtod returns a IEEE double. If you would like to use this routine,
  51.      you must compile your code with the +fi flag to cc to use IEEE floats
  52.      instead of ffp floats.
  53.  
  54. AUTHOR
  55.      Richard A. O'Keefe, 11/03/89
  56.  
  57.  
  58.  
  59.