How can I compute the range of signed and unsigned types
Many of your questions may have already been answered in earlier discussions or in the FAQ. The search results page will indicate current discussions as well as past list serves, articles, and papers.
kragen at pobox.com kragen at pobox.comSat May 5 00:17:40 PDT 2001
- Previous message: Athlon SDR/DDR stats for *specific* gaussian98 jobs
- Next message: CCGrid 2001: Final call for participation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
James Cownie <jcownie at etnus.com> writes: > Jag wrote : - > > Those sizes are defined for the C language. In order words, no > > matter if you're on a 32-bit machine or a 64-bit machine, an int is > > always going to be 32-bit and thus have the same numeric range > > No, the C standard says nothing of the sort. > > All the C standard says is that > > 1) sizeof (char) == 1 > 2) sizeof (short) >= sizeof (char) > 3) sizeof (int) >= sizeof (short) > 4) sizeof (long) >= sizeof (int) > 5) sizeof (long long) >= sizeof (long). > > It also does not specify that the representation of an int is two's > complement, so even on machines with the same sizeof(int) the legal > ranges could differ. It also says sizeof(short) >= 2 and sizeof(long) >= 4, IIRC, and the old ANSI C standard didn't say anything about long long. I haven't read C9X.
- Previous message: Athlon SDR/DDR stats for *specific* gaussian98 jobs
- Next message: CCGrid 2001: Final call for participation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Beowulf mailing list
