Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!lll-lcc!scowles From: scowles@lll-lcc.UUCP (Sid Cowles) Newsgroups: comp.unix.xenix Subject: float cast on sco xenix 2.1.3 Keywords: (float)MAXINT, sco xenix 2.1.3 Message-ID: <2454@lll-lcc.UUCP> Date: 29 Apr 89 00:54:38 GMT Reply-To: scowles@lll-lcc.llnl.gov (Sid Cowles) Distribution: usa Organization: Lawrence Livermore Labs, env sci div, Livermore CA Lines: 23 Summary: Expires: Sender: Followup-To: 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 #include 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@lll-lcc.llnl.gov =======================================================================