|
From: Tatsuro M. <tma...@ya...> - 2010-10-05 02:55:01
|
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
|
|
From: Tatsuro M. <tma...@ya...> - 2010-10-05 04:13:55
|
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
|
|
From: Allin C. <cot...@wf...> - 2010-10-05 13:30:06
|
On Tue, 5 Oct 2010, Tatsuro MATSUOKA wrote: > For current windows binaries, > gnuplot> pr NaN > 0.0 > > This is not correct. I can confirm that this is what I get running current CVS gnuplot for Windows on wine (my own build, using cross-mingw on Linux). Allin Cottrell |
|
From: Tatsuro M. <tma...@ya...> - 2010-10-07 09:12:15
|
Hello Thank you for your confirming the issue. Your report reveals the issue genetic to the mingw platform. Regards Tatsuro --- Allin Cottrell wrote: > On Tue, 5 Oct 2010, Tatsuro MATSUOKA wrote: > > > For current windows binaries, > > gnuplot> pr NaN > > 0.0 > > > > This is not correct. > > I can confirm that this is what I get running current CVS gnuplot > for Windows on wine (my own build, using cross-mingw on Linux). > > Allin Cottrell > -------------------------------------- Learn more about breast cancer - Pink Ribbon Campaign 2010 http://yj.pn/JAy9L7 |
|
From: Tatsuro M. <tma...@ya...> - 2010-10-10 07:00:42
Attachments:
stdfn.c.diff
|
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 |
|
From: sfeam (E. Merritt) <eam...@gm...> - 2010-10-10 18:08:31
|
On Sunday, October 10, 2010, Tatsuro MATSUOKA wrote: > > > 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.'. Added to CVS. Thanks, Ethan |
|
From: Tatsuro M. <tma...@ya...> - 2010-10-10 20:42:14
|
Hello I have confirmed the fix of cvs source and also confirmed that binaries built with the fixed source fixes the problem. Thanks!! Regards --- "sfeam (Ethan Merritt)" wrote: > On Sunday, October 10, 2010, Tatsuro MATSUOKA wrote: > > > > > 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.'. > > Added to CVS. > Thanks, > > Ethan > -------------------------------------- Learn more about breast cancer - Pink Ribbon Campaign 2010 http://yj.pn/JAy9L7 |