home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / src / dumpflt.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-16  |  1.1 KB  |  45 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. #include "stdafx.h"
  12. #include <float.h>
  13.  
  14. #ifdef AFX_DBG1_SEG
  15. #pragma code_seg(AFX_DBG1_SEG)
  16. #endif
  17.  
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // Diagnostic Stream output for floating point numbers
  25.  
  26. #ifdef _DEBUG
  27. CDumpContext& CDumpContext::operator<<(float f)
  28. {
  29.     char szBuffer[32];
  30.     _gcvt(f, FLT_DIG, szBuffer);
  31.     *this << szBuffer;
  32.     return *this;
  33. }
  34.  
  35. CDumpContext& CDumpContext::operator<<(double d)
  36. {
  37.     char szBuffer[32];
  38.     _gcvt(d, DBL_DIG, szBuffer);
  39.     *this << szBuffer;
  40.     return *this;
  41. }
  42. #endif
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45.