Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. /***
  2. * istrldbl.cpp - definitions for istream class operator>>(long double) funct
  3. *
  4. * Copyright (c) 1991-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Definitions of operator>>(long double) member function for istream
  8. * class.
  9. * [AT&T C++]
  10. *
  11. *Revision History:
  12. * 09-26-91 KRS Created. Split off from istream.cxx for granularity.
  13. * 12-30-92 KRS Fix indirection problem with **endptr.
  14. * 05-10-93 CFW Re-enable function, use strtod since no _strtold.
  15. * 06-14-95 CFW Comment cleanup.
  16. *
  17. *******************************************************************************/
  18. #include <cruntime.h>
  19. #include <internal.h>
  20. #include <stdlib.h>
  21. #include <iostream.h>
  22. #pragma hdrstop
  23. #pragma check_stack(on) // large buffer(s)
  24. #define MAXLDBLSIZ 32
  25. istream& istream::operator>>(long double& n)
  26. {
  27. _WINSTATIC char ibuffer[MAXLDBLSIZ];
  28. char ** endptr = (char**)NULL;
  29. if (ipfx(0))
  30. {
  31. if (getdouble(ibuffer, MAXLDBLSIZ)>0)
  32. {
  33. n = (long double)strtod(ibuffer, endptr);
  34. }
  35. isfx();
  36. }
  37. return *this;
  38. }