home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / MATHSRC.ZIP / ATOLD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.6 KB  |  47 lines

  1. /*------------------------------------------------------------------------
  2.  * filename - atold.c
  3.  *
  4.  * function(s)
  5.  *        _atold - converts a string to a long double
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16. #include <stdlib.h>
  17.  
  18. /*--------------------------------------------------------------------------*
  19.  
  20. Name            _atold - converts a string to a long double number
  21.  
  22. Usage           long double _atold(const char *strP);
  23.  
  24. Prototype in    stdlib.h & math.h
  25.  
  26. Description     _atold converts a string pointed to by strP to a long double;
  27.                 this functions recognizes:
  28.                         - an optional string of tabs and spaces
  29.                         - an optional sign
  30.                         - the  a string of  digits and an  optional decimal
  31.                           point
  32.                         - the  an optional e  or E followed  by an optional
  33.                           signed integer
  34.  
  35.                 The first unrecognized character ends the conversion. There
  36.                 are no provisions for overflow.
  37.  
  38. Return value    _atold returns  the converted value  of the input  string. If
  39.                 the  string cannot  be converted  to a  number of  the type
  40.                 long double, the return value is 0.
  41.  
  42. *---------------------------------------------------------------------------*/
  43. long double _atold(const char *strP)
  44. {
  45.     return _strtold(strP, NULL);
  46. }
  47.