Change 15293 by jhi@alpha on 2002/03/18 14:14:17

        Subject: [PATCH] re: long double vs. Tru64 UNIX 
        From: Spider Boardman <[EMAIL PROTECTED]>
        Date: Mon, 18 Mar 2002 10:09:50 -0500
        Message-Id: <[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/README.tru64#6 edit
.... //depot/perl/hints/dec_osf.sh#43 edit

Differences ...

==== //depot/perl/README.tru64#6 (text) ====
Index: perl/README.tru64
--- perl/README.tru64.~1~       Mon Mar 18 07:30:05 2002
+++ perl/README.tru64   Mon Mar 18 07:30:05 2002
@@ -48,6 +48,14 @@
 Tru64 V5.0, the long double support simply wasn't functional before
 that.
 
+At the time of this writing, there's a bug in the Tru64 libc printing
+of long doubles when not using "e" notation.  The values are correct
+and usable, but you only get a limited number of digits displayed
+unless you force the issue by using C<printf "%.33e",$num> or the like.
+For Tru64 versions V5.0A through V5.1A, a patch is expected sometime after
+perl 5.8.0 is released.  If your libc has not yet been patched, you'll get
+a warning from Configure when selecting long doubles.
+
 =head2 64-bit Perl on Tru64
 
 In Tru64 Perl's integers are automatically 64-bit wide, there is

==== //depot/perl/hints/dec_osf.sh#43 (text) ====
Index: perl/hints/dec_osf.sh
--- perl/hints/dec_osf.sh.~1~   Mon Mar 18 07:30:05 2002
+++ perl/hints/dec_osf.sh       Mon Mar 18 07:30:05 2002
@@ -310,6 +310,41 @@
 EOF
                exit 1
                ;;
+       *)
+               # Test whether libc's been fixed yet.
+               cat >try.c <<\TRY
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+       unsigned long uvmax = ~0UL;
+       long double ld = uvmax + 0.0L;
+       char buf1[30], buf2[30];
+
+       (void) sprintf(buf1, "%lu", uvmax);
+       (void) sprintf(buf2, "%.0Lf", ld);
+       return strcmp(buf1, buf2) != 0;
+}
+TRY
+               # Don't bother trying to work with Configure's idea of
+               # cc and the various flags.  This might not work as-is
+               # with gcc -- but we're testing libc, not the compiler.
+               if cc -o try -std try.c && ./try
+               then
+                       : ok
+               else
+                       cat <<\UGLY >&4
+!
+Warning!  Your libc has not yet been patched so that its "%Lf" format for
+printing long doubles shows all the significant digits.  You will get errors
+in the t/op/numconvert test because of this.  (The data is still good
+internally, and the "%e" format of printf() or sprintf() in perl will still
+produce valid results.)  See README.tru64 for additional details.
+
+Continuing anyway.
+!
+UGLY
+               fi
+               $rm -f try try.c
        esac
        ;;
 esac
End of Patch.

Reply via email to