Nп/п : 1 из 100
 От   : gah4                                2:5075/128        28 авг 23 06:19:12
 К    : Kim Hanjoon                                           28 авг 23 16:23:02
 Тема : Re: Real number precision in fortran
----------------------------------------------------------------------------------
                                                                                 
@MSGID:
<3883c7bc-48d1-4910-bd1a-c55cb92c92bdn@googlegroups.com> edabbf55
@REPLY:
<3cb57395-be28-4451-9e98-c20ed41386fbn@googlegroups.com> 146f6379
@REPLYADDR gah4 <gah4@u.washington.edu>
@REPLYTO 2:5075/128 gah4
@CHRS: CP866 2
@RFC: 1 0
@RFC-References:
<873f9cc4-6139-4bd3-9ed8-de7e37a76730n@googlegroups.com> <d24b9f27-36da-4011-963d-eba713b1f16an@googlegroups.com>
<3cb57395-be28-4451-9e98-c20ed41386fbn@googlegroups.com>
@RFC-Message-ID:
<3883c7bc-48d1-4910-bd1a-c55cb92c92bdn@googlegroups.com>
@TZUTC: -0700
@PID: G2/1.0
@TID: FIDOGATE-5.12-ge4e8b94
On Sunday, August 27, 2023 at 5:45:25 PM UTC-7, Kim Hanjoon wrote:
 > Thank you! I have never expected fortran`s default precision is
float not double.

DOUBLE PRECISION didn`t come until Fortran II, in 1958, on the
vacuum tube powered IBM 704 with up to (and often less than)
32K words of 36 bits each.  The first machine with hardware floating
point, and only the 36 bit single precision.

C originated as a systems programming language, for writing things
like OS and compilers.  Most often those didn`t need much floating
point, but C did supply them.  All expressions were evaluated in double
precision, and library routines only existed in double precision. 

The C types were, and still are, float and double, which I note in your comment.

With the ANSI C standard in 1989, expressions could be evaluated in single
precision, but constants continued to default to double.  A trailing f is used
for single precision constants, and leading f for single precision functions.
That was, then, about 31 years after Fortran originated double precision,
in software on a the first machine with floating point hardware.

The first Fortran standard in 1966 included most, but not all, the features
from IBM`s Fortran IV, an upgrade from the Fortran II on the 704.

IBM had upgraded from the 704 to the still vacuum tube powered 709,
and then the transistorized version, the 7090, still with only single
precision hardware.

Double precision in hardware seems to go to the IBM 7094, an upgrade
of the 7090,  in 1962.

IBM S/360 in the mid 1960`s decreased the word size to 32 bits, with a
single precision 32 bit format, and double precision 64 bit format. 
The change from 36 bits to 32 bits mean that much floating point that
was done in 36 bits, instead went to the 64 bit double precision type.

C was internal to Bell labs in 1976, with the book defining it released in 1978.

Note also that Fortran defines a double precision type as twice as big as
the single precision type, but mostly not the size of either one.

In the 1960`s, CDC introduced its 60 bit machines, with hardware 60 bit
and software 120 bit double precision floating point.  Fortran programmers
commonly used single precision on such machines, but double on the popular,
at about that time, IBM S/360 machines.

The second version of the Fortran standard in 1977 didn`t change much of
the way floating point was done, but did introduce a CHARACTER data type
for the first time. 

With the Fortran 90 and 95 standards, it was desired to keep as much as
possible compatible with the previous versions, so old programs would still
work the same way they always did.


By this time, programmers (except in CDC installations) were used to
using double precision constants with the D0 suffix.  (Or other D
values, as needed.)

So, the default double precision constants originated in the system
programming language C, originally not popular for scientific programming.
It became more popular for scientific programming in the late 1980`s,
about the time that the IBM PC with optional 8087 floating point processor,
and not so much later PC/AT with 80286 and optional 80287 floating point
processor were becoming more popular.  The 8087 does all arithmetic in 80 
bit registers, usually with the full 64 bit significand.
--- G2/1.0
 * Origin: usenet.network (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх