Posts

Showing posts from March, 2024

FP epsilon estimation in Fortran

Image
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 th

Text file statistics in C

Image
This program is a simple demonstration for illustrating how basic text file statistics can be retrieved with only 50 lines of C code. It is more or less a replacement of the standard 'wc' program available in all Unix/Linux distributions for returning the lines, words and characters of any text file given as input. Enable captions for more details and walk-through. Source code available at the Github repository (see channel info). Tags: #asmr #coding #programming #notalking #c-language #gcc #terminal #console

Datetime difference in PHP

Image
This is just a small snippet of PHP code illustrating the use of generic variables and console (server-side) scripting. Although PHP is almost entirely focused on web application development, basic syntax and features make it a general-purpose programming choice like other more popular alternatives, e.g. Python, Perl, Tcl, Bash, etc. Enable captions for more details and walk-through. Source code available at the Github repository (see channel info). Tags: #asmr #coding #programming #notalking #php #terminal #console

Channel Updates