dumpflt.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #include "stdafx.h"
  11. #include <float.h>
  12. #ifdef AFX_DBG1_SEG
  13. #pragma code_seg(AFX_DBG1_SEG)
  14. #endif
  15. #ifdef _DEBUG
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19. /////////////////////////////////////////////////////////////////////////////
  20. // Diagnostic Stream output for floating point numbers
  21. #ifdef _DEBUG
  22. CDumpContext& CDumpContext::operator<<(float f)
  23. {
  24. char szBuffer[32];
  25. _gcvt(f, FLT_DIG, szBuffer);
  26. *this << szBuffer;
  27. return *this;
  28. }
  29. CDumpContext& CDumpContext::operator<<(double d)
  30. {
  31. char szBuffer[32];
  32. _gcvt(d, DBL_DIG, szBuffer);
  33. *this << szBuffer;
  34. return *this;
  35. }
  36. #endif
  37. /////////////////////////////////////////////////////////////////////////////