Re: random_number
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Sun, 24 Jul 2005 22:15:39 -0700
Gordon Sande wrote: (snip)
There have been Fortrans on machines of other word sizes in the past. 36 bits was "the standard" at one point in history. Some machines even used sign magnitude (twos complement in other jargons) for symmetric ranges.
This is common confusion between "the compiler I use" and "the standard". There have been several threads over how small the range of integers could be and still meet the standard.
I am pretty sure that Fortran still allows other than 32 bits, and
twos complement, ones complement, or sign magnitude, and probably
even allows decimal (sign magnitude, nines complement or tens complement, or even more).
Historically, sign magnitude was used more, as it is more like the way people do it on paper. The IBM 704 is 36 bit sign magnitude.
Like sign magnitude, ones complement is also symmetric with positive and negative zero, but easier for doing addition and subtraction.
CDC made ones complement machines, and Univac still does.
A parallel adder is just about as easy to build in ones complement,
the difference is that the carry out from the MSB is used as a carry in to the LSB.
C still allows twos complement, ones complement and sign magnitude for signed arithmetic. Unsigned is unsigned. C does not allow decimal representation unless it is made to look like binary.
-- glen
.
- Follow-Ups:
- Re: random_number
- From: e p chandler
- Re: random_number
- References:
- Re: random_number
- From: glen herrmannsfeldt
- Re: random_number
- From: Ingo Thies
- Re: random_number
- From: Steven G. Kargl
- Re: random_number
- From: Tim Prince
- Re: random_number
- From: Gordon Sande
- Re: random_number
- Prev by Date: Re: random_number
- Next by Date: Re: exploring a fortran(?) library
- Previous by thread: Re: random_number
- Next by thread: Re: random_number
- Index(es):
Relevant Pages
|