home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / nspr30-e.zip / nspr30-e / include / prdtoa.h < prev    next >
C/C++ Source or Header  |  1998-11-02  |  2KB  |  72 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /*
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  * 
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  * 
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef prdtoa_h___
  20. #define prdtoa_h___
  21.  
  22. #include "prtypes.h"
  23.  
  24. PR_BEGIN_EXTERN_C
  25.  
  26. /*
  27. ** PR_strtod() returns as a double-precision floating-point number
  28. ** the  value represented by the character string pointed to by
  29. ** s00. The string is scanned up to the first unrecognized
  30. ** character.
  31. **a
  32. ** If the value of se is not (char **)NULL, a  pointer  to
  33. ** the  character terminating the scan is returned in the location pointed
  34. ** to by se. If no number can be formed, se is set to s00, and
  35. ** zero is returned.
  36. */
  37. #if defined(HAVE_WATCOM_BUG_1)
  38. /* this is a hack to circumvent a bug in the Watcom C/C++ 11.0 compiler
  39. ** When Watcom fixes the bug, remove the special case for Win16
  40. */
  41. PRFloat64 __pascal __loadds __export
  42. #else
  43. PR_EXTERN(PRFloat64)
  44. #endif
  45. PR_strtod(const char *s00, char **se);
  46.  
  47. /*
  48. ** PR_cnvtf()
  49. ** conversion routines for floating point
  50. ** prcsn - number of digits of precision to generate floating
  51. ** point value.
  52. */
  53. PR_EXTERN(void) PR_cnvtf(char *buf, PRIntn bufsz, PRIntn prcsn, PRFloat64 fval);
  54.  
  55. /*
  56. ** PR_dtoa() converts double to a string.
  57. **
  58. ** ARGUMENTS:
  59. ** If rve is not null, *rve is set to point to the end of the return value.
  60. ** If d is +-Infinity or NaN, then *decpt is set to 9999.
  61. **
  62. ** mode:
  63. **     0 ==> shortest string that yields d when read in
  64. **           and rounded to nearest.
  65. */
  66. PR_EXTERN(PRStatus) PR_dtoa(PRFloat64 d, PRIntn mode, PRIntn ndigits,
  67.     PRIntn *decpt, PRIntn *sign, char **rve, char *buf, PRSize bufsize);
  68.  
  69. PR_END_EXTERN_C
  70.  
  71. #endif /* prdtoa_h___ */
  72.