FP epsilon estimation in Fortran

Floating-point epsilon estimation in retro Fortran no-talking, in emulated 80286 / MS-DOS machine in DOSbox. This program implements floating-point 'epsilon' estimation in retro Fortran no-talking, in emulated 80286 / MS-DOS machine in DOSbox. This very short code demonstrates how easy it is to get the actual FP accuracy, i.e., the significant decimal digits in FP arithmetic operations. The result in Fortran 77 is seven FP digits for REAL type and 15 digits for DOUBLE PRECISION type, which are consistent with 2-byte and 4-byte float types, correspondingly, used in other programming languages of that era like C.

Warning: In some older versions of Microsoft's Fortran 77, the batch process 'FORT.BAT' assumed that the input filename is given as argument *without* the '.FOR' extension. If it is given, then the output is unpredictable and usually results in a corrupted *original* (source) file! Make sure to always keep backup before compiling - I had to write the source code twice because of this.

Enable captions for more details and walk-through. Source code available at the Github repository (see channel info).

Tags: #asmr #coding #programming #notalking #fortran #retro #msdos #dosbox

Comments

Popular Posts

Hello x86: Low-level assembly coding for the 8086

Announcement: Writing a new book in Data Science and R&D projects

Fibonacci numbers in C (4 different ways)

Multiplication tables in COBOL

Bricks and towers in Prolog

Channel Updates