develooper Front page | perl.perl5.porters | Postings from June 2001

Re: Report /pro/3gl/CPAN/perl-5.7.1

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
June 26, 2001 15:01
Subject:
Re: Report /pro/3gl/CPAN/perl-5.7.1
Message ID:
20010626230142.E59620@plum.flirble.org
On Mon, Jun 25, 2001 at 05:27:44PM -0500, Jarkko Hietaniemi wrote:

> 
> tcsh ibmsp01e:/tmp/jhi/perl/t ; ./perl -I../lib x
> not ok 13 # int(279964589018079/59) is 4745162525730, not 4745162525730
> SV = PVNV(0x2005c5d8) at 0x20041f84

>   NV = 4745162525730
>   NV = 4745162525730

This is crazy. They appear to be the same.
What does C think? I believe that the translation is

________________________________________________________________
#include <stdio.h>

int main (void) {
  long double a = 279964589018079;
  long double y = 4745162525730;
  long double x;

  x = a / 59;
  (void) modfl(x, &x);

  printf ("x=%.64Lg\n", x);
  printf ("y=%.64Lg\n", y);
  if (x == y)
    puts ("x==y");
  else
    puts ("x!=y");
  
  return 0;
}
________________________________________________________________

which on all the platforms I can test on (ARMLinux, where sizeof(long
double) == sizeof(double) and x86 FreeBSD, where I had to s/modfl/modf/)
I got == on both.

What are the values of HAS_MODFL and HAS_MODFL_POW32_BUG on the unhappy
platform (AIX, isn't it?)

Nicholas Clark

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