Category : Files from Magazines
Archive   : CUJ0894.ZIP
Filename : XSTOD.C
// xstod -- _Stod LIMITED SUBSTITUTE
#include
#include
#include
#include
double _Stod(const char *s, char **ep, long pten)
{ // convert text to double and scale
double x = strtod(s, ep);
if (x != 0 && pten != 0)
{ // scale the result
while (pten < 0)
x /= 10, ++ pten; // MAY MISBEHAVE
while (0 < pten)
x *= 10, --pten; // MAY MISBEHAVE
if (x == 0 || x == HUGE_VAL || x == -HUGE_VAL)
errno = ERANGE; // MAY MISBEHAVE
}
return (x);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
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/