DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: R T

⟦5a7f9f4ed⟧ TextFile

    Length: 2354 (0x932)
    Types: TextFile
    Names: »README.sun4«

Derivation

└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
    └─⟦c319c2751⟧ »unix3.0/TeX3.0.tar.Z« 
        └─⟦036c765ac⟧ 
            └─⟦this⟧ »TeX3.0/TeXcontrib/gnutex/README.sun4« 

TextFile

Please note that (at least in some versions of the Sun compiler or
stdio library), the following bugs exist. 

BUG #1: This causes axes labels (in LATEX) and the plot ranges (the -l
option) to be printed incorrectly for some numbers. The solution? Get
Sun to fix the bug, or use %f or %e formats (see the "set format"
command). This has been fixed in SunOS 4.0. For the -l option plot
ranges, be wary that they may be incorrect.

DFK 11-30-88
-------------------------------------
On a Sun3, it works correctly:

Script started on Wed Nov 30 13:58:56 1988
grad2 dfk> more test.c
/* Program to demonstrate bug in printf for SunOS Sys4-3.2 on Sun4 */
/* David Kotz, Duke University */
main()
{
    printf("Should be 200000: %g\n", 200000.);
    printf("Should be 200: %-.3g\n", 200.);
    printf("Will be 200: %g\n", 200.);
}
grad2 dfk> cc -o t test.c
grad2 dfk> t
Should be 200000: 200000
Should be 200: 200
Will be 200: 200
grad2 dfk> 
script done on Wed Nov 30 13:59:24 1988

But on a Sun4, it does not work correctly:

Script started on Wed Nov 30 13:56:59 1988
romeo dfk> more test.c
/* Program to demonstrate bug in printf for SunOS Sys4-3.2 on Sun4 */
/* David Kotz, Duke University */
main()
{
    printf("Should be 200000: %g\n", 200000.);
    printf("Should be 200: %-.3g\n", 200.);
    printf("Will be 200: %g\n", 200.);
}
romeo dfk> cc -o t test.c
romeo dfk> t
Should be 200000: 2
Should be 200: 2
Will be 200: 200
romeo dfk> 
script done on Wed Nov 30 13:57:22 1988

----------------------------------------------------------------------
BUG #2: Happens on Sun4 Sys4-3.2, Sun3 and Sun4 SunOS 4.0
The sscanf routine incorrectly parses "00 12" with the format
"%f %f" and reads 0 and 0 instead of 0 and 12. This affects data
input. If your data file contains x coordinates that are zero but are
specified like '00' or '000' etc, then you wil read the wrong y
values. Check your data files or don't use a Sun4 until they fix the
bug. Example program below:

#include <stdio.h>
main()
{
    char *line1="0  12 34";
    char *line2="00 12 34";
    float x,y,z;
    int n;

    n = sscanf(line1, "%f %f %f", &x, &y, &z);
    printf("line is '%s', x is %f, y is %f, z is %f, n is %d\n",
		 line1, x, y, z, n);

    n = sscanf(line2, "%f %f %f", &x, &y, &z);
    printf("line is '%s', x is %f, y is %f, z is %f, n is %d\n", 
		 line2, x, y, z, n);
}