pr_strtod.rst (1345B)
1 PR_strtod 2 ========= 3 4 Converts the prefix of a decimal string to the nearest double-precision 5 floating point number. 6 7 8 Syntax 9 ------ 10 11 .. code:: 12 13 #include <prdtoa.h> 14 15 PRFloat64 PR_strtod(const char *s00, char **se); 16 17 18 Parameters 19 ~~~~~~~~~~ 20 21 The function has these parameters: 22 23 ``s00`` 24 The input string to be scanned. 25 ``se`` 26 A pointer that, if not ``NULL``, will be assigned the address of the 27 last character scanned in the input string. 28 29 30 Returns 31 ~~~~~~~ 32 33 The result of the conversion is a ``PRFloat64`` value equivalent to the 34 input string. If the parameter ``se`` is not ``NULL`` the location it 35 references is also set. 36 37 38 Description 39 ----------- 40 41 :ref:`PR_strtod` converts the prefix of the input decimal string pointed to 42 by ``s00`` to a nearest double-precision floating point number. Ties are 43 broken by the IEEE round-even rule. The string is scanned up to the 44 first unrecognized character. If the value of ``se`` is not 45 (``char **``) ``NULL``, :ref:`PR_strtod` stores a pointer to the character 46 terminating the scan in ``*se``. If the answer would overflow, a 47 properly signed ``HUGE_VAL`` (infinity) is returned. If the answer would 48 underflow, a properly signed 0 is returned. In both cases, 49 ``PR_GetError()`` returns the error code ``PR_RANGE_ERROR``. If no 50 number can be formed, ``se`` is set to ``s00``, and 0 is returned.