develooper Front page | perl.perl5.porters | Postings from September 2000

Re: [ID 20000901.003] Not OK: perl v5.7.0 +DEVEL6961 on

Thread Previous | Thread Next
From:
sthoenna
Date:
September 2, 2000 23:38
Subject:
Re: [ID 20000901.003] Not OK: perl v5.7.0 +DEVEL6961 on
Message ID:
uqes5gzkgC3A092yn@efn.org
In article <39B023F1.5F936D12@uk.sun.com>,
Alan Burlison <Alan.Burlison@uk.sun.com> wrote:
> Yitzchak Scott-Thoennes wrote:
> 
> > And the others?  Is there sSCNfldbl?  I'm guessing that perhaps sscanf
> > is storing a double into the long double *?  Or perhaps double -> NV
> > casting is broken for your compiler?  This seems the likeliest since I
> > think the problem appeared before the sscanf stuff was in.
> 
> Oh please - two different versions of the compiler on two different
> architectures and across two versions of the OS - all broken.  I think
> not.

Put that way, I agree.  Sorry, I didn't realize that the problem
was in more than one situation.  I also remembered your original
report saying you were getting:

cc -c  -DDL_UNLOAD_ALL_AT_EXIT -DDEBUGGING -I/usr/local/include -D_LARGEFILE_SOU
RCE -D_FILE_OFFSET_BITS=64 -g      -DVERSION=\"0.0400000000000000008326672684688
674\"  -DXS_VERSION=\"0.0400000000000000008326672684688674\" -KPIC -I../..  byte
run.c

and this was leading me to grasp at straws to make it just a string to
nv/nv to string conversion problem.  But obviously there is more than
just that problem here.  BTW, is the above fixed now with the sscanf
stuff in?

> #include <stdio.h>
> #include <float.h>
> int main()
> {
> long double ld;
> char buf[1024];
> sscanf("123.456", "%Lf", &ld);
> qgcvt(ld, LDBL_DIG, buf);
> printf("%s\n", buf);
> }
> 
> prints
> 123.456
> 
> Which looks fine to me.
> 
> It is perl that is broke.  However I dont think there is much chance of
> getting this sorted by the witching hour.  I'm more interested in
> getting perl to compile - this whole long double mess should be left
> until 5.7.0 is out.

I was assuming that, yes.  Now that 5.7.0 is out, can you try the following:
(in the perl build dir after Configure'ing)

#include "EXTERN.h"
#include "perl.h"
#include <stdio.h>
#define countof(x) (sizeof(x)/sizeof(x)[0])
int main(int argc, char **argv) {
   int i;
   NV nv, sum=0;
   char *addends[] = {"123","123.4","123e4","123.4E5","123.4e+5",".12"};
   char buf[1024];

   for (i = 0; i < countof(addends); ++i) {
      nv = 0;
      Perl_atof2(addends[i], nv);
      sum += nv;
      buf[0] = 0;
      Gconvert(nv, NV_DIG, 0, buf);
      printf("%s -> %s\n", addends[i], buf);
   }
   buf[0] = 0;
   Gconvert(sum, NV_DIG, 0, buf);
   printf("sum is %s (expected 25910246.52)\n", buf);
   return 0;
}

and see if a string conversion problem can be ruled in or out here.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About