nsprpub/pr/include/prdtoa.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/nsprpub/pr/include/prdtoa.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef prdtoa_h___
    1.10 +#define prdtoa_h___
    1.11 +
    1.12 +#include "prtypes.h"
    1.13 +
    1.14 +PR_BEGIN_EXTERN_C
    1.15 +
    1.16 +/*
    1.17 +** PR_strtod() returns as a double-precision floating-point number
    1.18 +** the  value represented by the character string pointed to by
    1.19 +** s00. The string is scanned up to the first unrecognized
    1.20 +** character.
    1.21 +**a
    1.22 +** If the value of se is not (char **)NULL, a  pointer  to
    1.23 +** the  character terminating the scan is returned in the location pointed
    1.24 +** to by se. If no number can be formed, se is set to s00, and
    1.25 +** zero is returned.
    1.26 +*/
    1.27 +NSPR_API(PRFloat64)
    1.28 +PR_strtod(const char *s00, char **se);
    1.29 +
    1.30 +/*
    1.31 +** PR_cnvtf()
    1.32 +** conversion routines for floating point
    1.33 +** prcsn - number of digits of precision to generate floating
    1.34 +** point value.
    1.35 +*/
    1.36 +NSPR_API(void) PR_cnvtf(char *buf, PRIntn bufsz, PRIntn prcsn, PRFloat64 fval);
    1.37 +
    1.38 +/*
    1.39 +** PR_dtoa() converts double to a string.
    1.40 +**
    1.41 +** ARGUMENTS:
    1.42 +** If rve is not null, *rve is set to point to the end of the return value.
    1.43 +** If d is +-Infinity or NaN, then *decpt is set to 9999.
    1.44 +**
    1.45 +** mode:
    1.46 +**     0 ==> shortest string that yields d when read in
    1.47 +**           and rounded to nearest.
    1.48 +*/
    1.49 +NSPR_API(PRStatus) PR_dtoa(PRFloat64 d, PRIntn mode, PRIntn ndigits,
    1.50 +	PRIntn *decpt, PRIntn *sign, char **rve, char *buf, PRSize bufsize);
    1.51 +
    1.52 +PR_END_EXTERN_C
    1.53 +
    1.54 +#endif /* prdtoa_h___ */

mercurial