Fortran dim (x, y), for what purpose?

In Fortran, dim (x, y) returns the difference xy if the result is positive; otherwise returns zero. What is it for? What is the meaning of the name dim?

+3
source share
2 answers

Presumably, it comes from a dimension, i.e. the length, width, height of something. Since none of these values ​​can be negative, it is calculated as a positive difference.

+3
source

Since this is (in some earlier Fortran literature) defined as DIM (A, B): = A-MIN (A, B), I would say that this name is the abbreviation "difference from minimum".

+1
source

Source: https://habr.com/ru/post/1707729/


All Articles