Print this page
11620 strtod man page typo equence


  52 
  53            o      One of INF or INFINITY, ignoring case
  54 
  55            o      One of NAN or NAN(n-char-sequence(opt)), ignoring case in
  56                   the NAN part, where:
  57 
  58                     n-char-sequence:
  59                         digit
  60                         nondigit
  61                         n-char-sequence digit
  62                         n-char-sequence nondigit
  63 
  64 
  65 
  66        In default mode for strtod(), only decimal, INF/INFINITY, and
  67        NAN/NAN(n-char-sequence) forms are recognized. In C99/SUSv3 mode,
  68        hexadecimal strings are also recognized.
  69 
  70 
  71        In default mode for strtod(), the n-char-sequence in the NAN(n-char-
  72        equence) form can contain any character except ')' (right parenthesis)
  73        or '\0' (null).  In C99/SUSv3 mode, the n-char-sequence can contain
  74        only upper and lower case letters, digits, and '_' (underscore).
  75 
  76 
  77        The strtof() and strtold() functions always function in
  78        C99/SUSv3-conformant mode.
  79 
  80 
  81        The subject sequence is defined as the longest initial subsequence of
  82        the input string, starting with the first non-white-space character,
  83        that is of the expected form. The subject sequence contains no
  84        characters if the input string is not of the expected form.
  85 
  86 
  87        If the subject sequence has the expected form for a floating-point
  88        number, the sequence of characters starting with the first digit or the
  89        decimal-point character (whichever occurs first) is interpreted as a
  90        floating constant of the C language, except that the radix character is
  91        used in place of a period, and that if neither an exponent part nor a
  92        radix character appears in a decimal floating-point number, or if a


 286 
 287                a.     If +HUGE_VAL is returned and errno is set to ERANGE, a
 288                       floating point overflow occurred while processing a
 289                       positive value, causing a floating point overflow
 290                       exception to be raised.
 291 
 292                b.     If -HUGE_VAL is returned and errno is set to ERANGE, a
 293                       floating point overflow occurred while processing a
 294                       negative value, causing a floating point overflow
 295                       exception to be raised.
 296 
 297                c.     If strtod() does not set errno to ERANGE, the value
 298                       specified by the "subject string" converted to +HUGE_VAL
 299                       or -HUGE_VAL, respectively.
 300            Note that if errno is set to ERANGE when strtod() is called, case
 301            (c) can be distinguished from cases (a) and (b) by examining either
 302            ERANGE or the overflow flag.
 303 
 304 
 305 
 306                                November 1, 2003                     STRTOD(3C)


  52 
  53            o      One of INF or INFINITY, ignoring case
  54 
  55            o      One of NAN or NAN(n-char-sequence(opt)), ignoring case in
  56                   the NAN part, where:
  57 
  58                     n-char-sequence:
  59                         digit
  60                         nondigit
  61                         n-char-sequence digit
  62                         n-char-sequence nondigit
  63 
  64 
  65 
  66        In default mode for strtod(), only decimal, INF/INFINITY, and
  67        NAN/NAN(n-char-sequence) forms are recognized. In C99/SUSv3 mode,
  68        hexadecimal strings are also recognized.
  69 
  70 
  71        In default mode for strtod(), the n-char-sequence in the NAN(n-char-
  72        sequence) form can contain any character except ')' (right parenthesis)
  73        or '\0' (null).  In C99/SUSv3 mode, the n-char-sequence can contain
  74        only upper and lower case letters, digits, and '_' (underscore).
  75 
  76 
  77        The strtof() and strtold() functions always function in
  78        C99/SUSv3-conformant mode.
  79 
  80 
  81        The subject sequence is defined as the longest initial subsequence of
  82        the input string, starting with the first non-white-space character,
  83        that is of the expected form. The subject sequence contains no
  84        characters if the input string is not of the expected form.
  85 
  86 
  87        If the subject sequence has the expected form for a floating-point
  88        number, the sequence of characters starting with the first digit or the
  89        decimal-point character (whichever occurs first) is interpreted as a
  90        floating constant of the C language, except that the radix character is
  91        used in place of a period, and that if neither an exponent part nor a
  92        radix character appears in a decimal floating-point number, or if a


 286 
 287                a.     If +HUGE_VAL is returned and errno is set to ERANGE, a
 288                       floating point overflow occurred while processing a
 289                       positive value, causing a floating point overflow
 290                       exception to be raised.
 291 
 292                b.     If -HUGE_VAL is returned and errno is set to ERANGE, a
 293                       floating point overflow occurred while processing a
 294                       negative value, causing a floating point overflow
 295                       exception to be raised.
 296 
 297                c.     If strtod() does not set errno to ERANGE, the value
 298                       specified by the "subject string" converted to +HUGE_VAL
 299                       or -HUGE_VAL, respectively.
 300            Note that if errno is set to ERANGE when strtod() is called, case
 301            (c) can be distinguished from cases (a) and (b) by examining either
 302            ERANGE or the overflow flag.
 303 
 304 
 305 
 306                                 August 25, 2019                     STRTOD(3C)