Question

In Fortran dim(x,y) returns the difference x-y if the result is positive; otherwise returns zero. What was it intended to be used for? What is the meaning behind the name dim?

Was it helpful?

Solution

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

OTHER TIPS

Since it is (in some older literature on Fortran) defined as DIM(A,B):=A-MIN(A,B), I'd say that the name is just an abbreviation for "difference from minimum".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top