Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!cs.utexas.edu!romp!auschs!awdprime!news From: news@awdprime.UUCP (USENET News) Newsgroups: comp.lang.c Subject: Re: New Data Type? Message-ID: <1885@awdprime.UUCP> Date: 23 Mar 90 01:44:04 GMT References: <9918@wpi.wpi.edu> Reply-To: cs.utexas.edu!ibmaus!auschs!sanders!sanders (Tony Sanders) Distribution: na Organization: contract to IBM AWD, Austin, TX Lines: 28 In article <9918@wpi.wpi.edu> oesterle@wpi.wpi.edu (Shawn H. Oesterle) writes: >The following C data types have incremental sizes of 2^n bytes: >(unsigned) char, short, and long. Some compilers have data type Actually, it doesn't say anywhere that a short cannot be the same size as a long, additionally a long could very well be 128 bits (or whatever the size supported by the hardware is). Quoting from K&R2 (2.2 Data Types and Sizes): The intent is that short and long should provide different lengths of integers where practical; int will normally be the natural size for a particular machine. ... Each complier is free to choose appropriate sizes for its own hardware, subject only to the restriction that shorts and ints are at least 16 bits, longs are at least 32 bits, and short is no longer than int, which is no longer than long. >called 'long long' which is 64 bits long. If 128 bit computers true, some people have added 'long long'. In cases where you wanted to maximize precision (and have portable code) you would have to figure out the range (from standard headers or by computation) of the data type and make your function smart enough to use those values at run time. -- sanders For every message of the day, a new improved message will arise to overcome it. Reply-To: cs.utexas.edu!ibmaus!auschs!sanders.austin.ibm.com!sanders (ugh!)