prdtoa.h (1593B)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #ifndef prdtoa_h___ 7 #define prdtoa_h___ 8 9 #include "prtypes.h" 10 11 PR_BEGIN_EXTERN_C 12 13 /* 14 ** PR_strtod() returns as a double-precision floating-point number 15 ** the value represented by the character string pointed to by 16 ** s00. The string is scanned up to the first unrecognized 17 ** character. 18 **a 19 ** If the value of se is not (char **)NULL, a pointer to 20 ** the character terminating the scan is returned in the location pointed 21 ** to by se. If no number can be formed, se is set to s00, and 22 ** zero is returned. 23 */ 24 NSPR_API(PRFloat64) 25 PR_strtod(const char *s00, char **se); 26 27 /* 28 ** PR_cnvtf() 29 ** conversion routines for floating point 30 ** prcsn - number of digits of precision to generate floating 31 ** point value. 32 */ 33 NSPR_API(void) PR_cnvtf(char *buf, PRIntn bufsz, PRIntn prcsn, PRFloat64 fval); 34 35 /* 36 ** PR_dtoa() converts double to a string. 37 ** 38 ** ARGUMENTS: 39 ** If rve is not null, *rve is set to point to the end of the return value. 40 ** If d is +-Infinity or NaN, then *decpt is set to 9999. 41 ** 42 ** mode: 43 ** 0 ==> shortest string that yields d when read in 44 ** and rounded to nearest. 45 */ 46 NSPR_API(PRStatus) PR_dtoa(PRFloat64 d, PRIntn mode, PRIntn ndigits, 47 PRIntn *decpt, PRIntn *sign, char **rve, char *buf, PRSize bufsize); 48 49 PR_END_EXTERN_C 50 51 #endif /* prdtoa_h___ */