1. /* sdmsLdbl.cpp by K.Tsuru */
  2. // function ID = 303 DRADIX since version 2.31
  3. /******************************************************************
  4. SDouble class
  5. It sets a value by long double, including long, etc.
  6. via std::stringstream and StringToNumber class.
  7. ********************************************************************/
  8. #ifndef SN_H
  9. #include "sn.h"
  10. #endif
  11. static const char* const func = "SetLongDouble";
  12. void SDouble::SetLongDouble(ldouble ld){
  13. if(ld == 0.0){
  14. if(RawSign()) SetZero();
  15. return; // d = 0, sign = 0
  16. }
  17. if(Type() == BIN_DEC) SetError(RADIX_ERR, func, 303);
  18. stringstream ss;
  19. ss << setprecision(LDBL_DIG+2) << ld;
  20. string temp = (string)ss.str();
  21. SetString(temp.c_str());
  22. }

sdmsLdbl.cpp : last modifiled at 2017/08/28 11:48:01(738 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).