float cast on sco xenix 2.1.3

Sid Cowles scowles at lll-lcc.UUCP
Sat Apr 29 10:54:38 AEST 1989


in the following program, the cast in the first print statement does
not work correctly.  in sco 2.1.3, int's are default 2 bytes, yet the
float cast is looking at 4 bytes.  please, what did i miss?
(i included the MAXSHORT for comparison since its definition includes 
the short spec; where MAXINT is forced short (ex. 3), the cast works
fine.)
====
#include <stdio.h>
#include <values.h>
main()
{
/*1*/ fprintf(stdout,"(float)MAXINT: %f\n",(float)MAXINT);
/*2*/ fprintf(stdout,"(float)MAXSHORT: %f\n",(float)MAXSHORT);
/*3*/ fprintf(stdout,"(float)(short)MAXINT: %f\n",(float)(short)MAXINT);
}
====
thanks,
sid
=======================================================================
s cowles
uucp:      {backbone}!lll-lcc!scowles
internet:  scowles at lll-lcc.llnl.gov
=======================================================================



More information about the Comp.unix.xenix mailing list