From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10352 invoked by alias); 24 Aug 2002 17:44:53 -0000 Mailing-List: contact gsl-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sources.redhat.com Received: (qmail 10332 invoked from network); 24 Aug 2002 17:44:48 -0000 Received: from unknown (HELO mailrelay2.lrz-muenchen.de) (129.187.254.102) by sources.redhat.com with SMTP; 24 Aug 2002 17:44:48 -0000 Received: from [129.187.28.19] by mailout.lrz-muenchen.de with ESMTP; Sat, 24 Aug 2002 19:44:44 +0200 Message-Id: <3D67C620.4050306@lrz.de> Date: Sat, 24 Aug 2002 10:44:00 -0000 From: Reinhold Bader Organization: Leibniz-Rechenzentrum User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: en, de, en-us MIME-Version: 1.0 To: Brian Gough CC: Reinhold Bader , gsl-discuss@sources.redhat.com Subject: Re: GSL on Hitachi SR8000 References: <3D66010C.6020002@lrz.de> <15718.36054.573517.309284@debian> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-q3/txt/msg00167.txt.bz2 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? >