Category : Files from Magazines
Archive   : CUJ0894.ZIP
Filename : ISXDBL.C

 
Output of file : ISXDBL.C contained in archive : CUJ0894.ZIP
-------------------------- Listing 10: double extractor ---------

// isxdouble -- istream::operator>>(double&)
#include
#include
#include

istream& istream::operator>>(double& d)
{ // extract a double
_TRY_IO_BEGIN
if (!ipfx())
setstate(failbit);
else
{ // gather characters and convert
char ac[_MAX_EXP_DIG+_MAX_SIG_DIG+16];
char *ep;
errno = 0;
const double x = _Stod(ac, &ep, _Getffld(ac));
if (ep == ac || errno != 0)
setstate(failbit);
else
d = x;
}
isfx();
_CATCH_IO_END
return (*this);
}


  3 Responses to “Category : Files from Magazines
Archive   : CUJ0894.ZIP
Filename : ISXDBL.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/