|
From: Tatsuro M. <tma...@ya...> - 2010-10-10 07:00:42
|
Hello
Ooops!
> So I changed from
> #if defined (__MSC__) || defined (DJGPP) || defined(__DJGPP__)
> to
> #if defined (__MSC__) || defined (DJGPP) || defined(__DJGPP__) || defined (__MinGW32__)
> but pr NaN gives 0.0.
I have just make a mistake in define MinGW.
The macro 'defined (__MinGW32__)' should be 'defined (__MINGW32__)'.
I have attached the patch. This makes 'pr NaN gives NaN.'.
Regards
Tatsuro
--- Tatsuro MATSUOKA wrote:
> Hello
>
> For current windows binaries,
> gnuplot> pr NaN
> 0.0
>
> This is not correct.
>
> For the cygwin and the djgpp (modified recently) give
> gnuplot> pr NaN
> NaN
>
> I have googled NaN for the MinGW, I have not obtained good information yet.
> So I have written the test code the below
>
> **************************************
> #include <stdio.h>
> #include <math.h>
>
>
> int main(void){
> double dbl;
> unsigned long uldbl[2];
>
> printf("test 0.0/0.0\n");
> dbl = 0.0/0.0;
> *( double* )uldbl = dbl;
> printf("%f \n",dbl);
> printf("isnan = %d \n",isnan(dbl));
> printf("%x %x\n", uldbl[0], uldbl[1]);
> printf("\n");
>
> printf("test 0xffffffff 0x7fffffff \n");
> uldbl[0]=0xffffffff; uldbl[1]= 0x7fffffff;
> dbl = *( double* )uldbl;
> printf("%f \n",dbl);
> printf("isnan = %d \n",isnan(dbl));
> printf("%x %x\n", uldbl[0], uldbl[1]);
> printf("\n");
>
> printf("test atof(\"NaN\") \n");
> dbl = atof("NaN");
> *( double* )uldbl = dbl;
> printf("%f \n",dbl);
> printf("isnan = %d \n",isnan(dbl));
> printf("%x %x\n", uldbl[0], uldbl[1]);
> printf("\n");
>
> printf("test atof(\"-1.#IND00\") \n");
> dbl = atof("-1.#IND00");
> *( double* )uldbl = dbl;
> printf("%f \n",dbl);
> printf("isnan = %d \n",isnan(dbl));
> printf("%x %x\n", uldbl[0], uldbl[1]);
> printf("\n");
>
> printf("test atof(\"1.#QNAN0\") \n");
> dbl = atof("1.#QNAN0");
> *( double* )uldbl = dbl;
> printf("%f \n",dbl);
> printf("isnan = %d \n",isnan(dbl));
> printf("%x %x\n", uldbl[0], uldbl[1]);
> printf("\n");
>
> printf("test 0 \n");
> dbl = 0;
> *( double* )uldbl = dbl;
> printf("%f \n",dbl);
> printf("isnan = %d \n",isnan(dbl));
> printf("%x %x\n", uldbl[0], uldbl[1]);
> printf("\n");
>
> return 0;
> }
> *************************
> The results are
>
> $ ./nan
> test 0.0/0.0
> -1.#IND00
> isnan = 1
> 0 fff80000
>
> test 0xffffffff 0x7fffffff
> 1.#QNAN0
> isnan = 1
> ffffffff 7fffffff
>
> test atof("NaN")
> 2293504.000000
> isnan = 0
> 0 41417f80
>
> test atof("-1.#IND00")
> 2293504.000000
> isnan = 0
> 0 41417f80
>
> test atof("1.#QNAN0")
> 2293504.000000
> isnan = 0
> 0 41417f80
>
> test 0
> 0.000000
> isnan = 0
> 0 0
>
> #******************
>
> >From above it seems to be
>
> unsigned long lnan[2]={0xffffffff, 0x7fffffff};
> return *( double* )lnan;
>
> is applicable as for the MSC and djgpp.
>
> So I changed from
> #if defined (__MSC__) || defined (DJGPP) || defined(__DJGPP__)
> to
> #if defined (__MSC__) || defined (DJGPP) || defined(__DJGPP__) || defined (__MinGW32__)
> but pr NaN gives 0.0.
>
> This is the current situation.
>
> Any suggestions?
>
> Regards
>
> Tatsuro
>
> --------------------------------------
> Learn more about breast cancer - Pink Ribbon Campaign 2010
> http://yj.pn/JAy9L7
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
> Spend less time writing and rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
--------------------------------------
Learn more about breast cancer - Pink Ribbon Campaign 2010
http://yj.pn/JAy9L7 |