GSL on Hitachi SR8000

Reinhold Bader Reinhold.Bader@lrz-muenchen.de
Sat Aug 24 10:44:00 GMT 2002


Right,

/usr/include/machine/float_limits defines, among other things

#define FLT_DIG         6
#define FLT_MIN         1.1754943508222875e-38F
#define FLT_MAX         3.4028234663852886e+38F

With these values the test program compiles without warnings and
runs correctly.


Concerning histogram, I've inserted some printf's after the fscanf
call:

     for (i = 0; i < N; i++)
       {
         if (h->range[i] != hh->range[i]) {
           printf("failure of range for i=%d: %20.16f %20.16f\n",i,h->range[i],abs(h->range[i] - hh->range[i]));
           status = 1;
         }
         if (h->bin[i] != hh->bin[i]) {
           printf("failure of bin for i=%d\n",i);
           status = 1;
         }
       }

and receive failures for h->range. Oddly enough, the absolute differences are
0:
failure of range for i=1:   0.0025188916876574   0.0000000000000000
failure of range for i=2:   0.0050377833753149   0.0000000000000000
failure of range for i=3:   0.0075566750629723   0.0000000000000000
failure of range for i=4:   0.0100755667506297   0.0000000000000000
failure of range for i=5:   0.0125944584382872   0.0000000000000000

perhaps the machine differentiates 0.0 and -0.0? Generally, comparing
floats etc. to equality is generally not a good idea (and you do
read in %lg's in gsl_histogram_fscanf)...


Best regards



Brian Gough wrote:
> Reinhold Bader writes:
>  > Questions:
> 
> Hi, 
> 
> Thanks for the bug report. It would be good to get GSL working on this
> platform.
> 
>  > 
>  > 1.  Do I need to change these constants elsewhere in the library source
>  >      to guarantee correct functionality? Does the above change indicate
>  >      that the number format on the SR8000 is non IEEE conformant?
> 
> Can you compare the values of FLT_MAX, FLT_MIN etc on your system with
> the ones used in test.c.  Try compiling with FLT_MAX, FLT_MIN in the
> source code instead of the hardcoded values.
> 
>  > 2.  The legendre failure seems minor. Any comments?
> 
> Yes, looks like a variation in rounding only.
> 
>  > 3.  The gsl_histogram stuff: not very urgent, but is there any hint
>  >       where things might have gone wrong in
>  >       gsl_histogram_fprintf and/or fscanf?
> 
> This error is perhaps more serious, I have never seen it fail before
> -- can you step through the appropriate part of the test program under
> the debugger?
> 
> Thanks,
> Brian Gough
> 
> p.s. what compiler do you use?
> 




More information about the Gsl-discuss mailing list