From: Kai T. <kti...@go...> - 2010-11-01 19:39:08
|
2010/11/1 Sisyphus <sis...@op...>: > Hi, > > The demo: > > ############################## > #include <stdio.h> > #include <stdlib.h> > > int main(void) { > double x; > char * ptr; > > x = strtod("nan", &ptr); > printf("%f\n", x); > > x = strtod("INf", &ptr); > printf("%f\n", x); > > return 0; > } > ############################## > > With the mingw.org compilers that I've tested, the output of that program > is: > > -1.#IND00 > 1.#INF00 > > But, on the same machine, with the mingw64 compilers that I've tested, the > output is: > > 0.000000 > 0.000000 > > Why the difference ? > > Cheers, > Rob Hi Rob, the difference is that we are exporting for strtod the msvcrt function and do not redirect to the internal c99 version of __strtod. If you use here __strtod instead, you will get c99 compatible behavior. Regards, Kai -- | (\_/) This is Bunny. Copy and paste | (='.'=) Bunny into your signature to help | (")_(") him gain world domination |